aws-samples / aws-samples/aws-lambda-mirror-dns-function

Lambda function reaches max timeout limit (5min) in diff_zones()

Đang mở
#8 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
41
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When running this Lambda function to mirror a zone containing a large amount of DNS records (~43500), it reaches max Lambda timeout limit of 5 minutes inside function `diff_zones()`.

The DNS `AXFR` request returns within `500` to `1000` milliseconds with `dig`, returning the 40k records very fast. The problem lies in the python code which needs to parse through all the `dns.zone.Zone` nodes, records, etc... and diff them to build the `differences` list.

The code never even gets to the looping over `differences` and running `update_resource_record()` to make changes to Route53.

It's hard to believe that the python code is so slow to generate a list of DNS zone differences. I can imagine a simple bash script using `dig` and `diff` that would be much more efficient to perform the same function for this portion of the Lambda code.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.