aws-samples / aws-lambda-ddns-function

Dynamically create Route 53 resource records using CloudWatch Events and Lambda
Apache License 2.0
236 stars 116 forks source link

Resolve split-horion DNS problem. (Issue #11) #12

Closed ktstevenson closed 7 years ago

ktstevenson commented 7 years ago

The get_zone_id(zone_name) function does not expect route53.list_hosted_zones() to return multiple zones. It always returns the first zoneid in the list. This commit modifies get_zone_id() to include an optional 'scope' parameter. If scope is 'private', it explicitly searches for matching private zones. If scope is 'public', it explicitly searches for matching public ones. If scope is omitted, the function operates with its original behavior.

get_zone_id() function calls throughout lambda_handler() were modified with scope parameters where needed.

This closes #11

ktstevenson commented 7 years ago

🤣 I just took a look at the split-horizon branch and realized that I've had nearly the same idea.

jicowan commented 7 years ago

Do you need me to look at the changes you made or can you use the split horizon version?

ktstevenson commented 7 years ago

It does basically the same thing as the split horizon version. I think there's a typo in the feature-split-horizon code, but I haven't chased it down yet.

Both versions suffer from errors on certain edge cases.

I'll close this request since you're already on the same path. I'm hoping to see the split horizon feature merged into head soon.