8000 Avoid ASG race condition · tied/aws-lambda-ddns-function@be42e02 · GitHub
[go: up one dir, main page]

Skip to content

Commit be42e02

Browse files
authored
Avoid ASG race condition
EC2 instances created from an ASG do not get tags applied immediately. This sleep avoids a race condition.
1 parent c2363c1 commit be42e02

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

union.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def lambda_handler(event, context):
3333
table = dynamodb_resource.Table('DDNS')
3434

3535
if state == 'running':
36+
time.sleep(60)
3637
instance = compute.describe_instances(InstanceIds=[instance_id])
3738
# Remove response metadata from the response
3839
instance.pop('ResponseMetadata')

0 commit comments

Comments
 (0)
0