aws-samples / aws-lambda-ddns-function

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

reverse record in new zone for each EC2 #26

Closed mchodson closed 5 years ago

mchodson commented 6 years ago

i have this working but via a terraform build instead of CFN + CLI calls. i didn't change anything.

i have an ASG with CNAME and ZONE tags. they map to a pre-existing zone.

when an ec2 instance is made i get an A record in that zone. looks like this ex: ip-10-68-1-163.int.systems. A 10.68.1.163

I also get a new reverse lookup hosted zone/domain. looks like this ex:

1.68.10.in-addr.arpa. 163.1.68.10.in-addr.arpa. | PTR | ip-10-68-1-163.us-west-2.compute.internal

when i delete the EC2 the A record and the PTR record are removed. But the rev lookup domain persists.

I'm wondering if the intention was for a rev lookup zone to already exist when using CNAME/ZONE tags? if not, why retain the domain if there are no more records in it? maybe i'm missing the point?

(also, great work on this, super userful!)

jicowan commented 5 years ago

Thanks @mchodson. I think this may have been an oversight on my part. I think I simply forgot to add the logic to delete the reverse lookup zone. The code should create a reverse lookup zone if it doesn't already exist.