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

Why need sleep 60 seconds if instance state is running? #31

Closed odessky2 closed 5 years ago

odessky2 commented 5 years ago

Hi! You have this code fragment:

if state == 'running':
  time.sleep(60)

Please explain, why need wait 60 seconds?

jicowan commented 5 years ago

This was to avoid a race condition. If I were to re-write this, I would probably break this apart into multiple functions and use step functions for orchestration.