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

Not all CNAME records created when instances are launched from auto-scaling group within CloudFormation template #1

Closed davidpartow closed 8 years ago

davidpartow commented 8 years ago

I wanted to thank you so much for publishing the whitepaper on dynamic DNS for Route 53 using Lambda and DynamoDB.

It works great!

I did come across one little issue, it just doesn't create CNAME records for when instances are launched from an auto-scaling group within a CloudFormation template. It does create CNAME records for when I launch the instance(s) manually.

UPDATE: I made sure to clear the DynamoDB table before launching the same CloudFormation template and for some strange reason it created 2 CNAME records but it didn't create all the CNAME records for the other instances that were launched. Maybe Lambda is not able to catch all of the instances launching at the same time. I am using the same tag you mentioned in the documentation.

David Partow AWS Certified Solutions Architect

jicowan commented 8 years ago

Try adding a sleep, time.sleep(), method to the beginning of the function. This will delay execution of rest of the function which should give CloudFormation enough time to apply the tags to the resources you're creating. For the next version, I will try replacing the current CW Event with an Event that listens for createTag.