GreenfieldTech / lambda-route53-updates

Java AWS Lambda package that receives notifications to update Route53 records
http://www.greenfieldtech.net/open-source/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

With DNS resolution disabled in a VPC, lambda fails to update records #2

Open guss77 opened 6 years ago

guss77 commented 6 years ago

There is a problem handling the life cycle actions of an auto-scaling group inside a VPC if the VPC has DNS resolution turned off.

In such a case, the VPC does not actually set a "public dns name" (or a private one either) to the instance - even though all AWS IPs have DNS names that can be found by reverse lookup. When the lambda tries to set up SRV records using a hostname, it fails to generate a correct format and errors out. If the same lambda is also responsible for setting up DNSRR, that also fails.

The lambda should detect this and fallback to something reasonable - either perform the reverse lookup to find a useful hostname or just use the IP address in the SRV record - there's no real reason to prefer a hostname there.

guss77 commented 6 years ago

closed by PR #3