Skip to content

Commit

Permalink
Merge pull request #751 from aws-samples/fix-cfn-cloud9
Browse files Browse the repository at this point in the history
Fix for loop when instance isn't running yet
  • Loading branch information
niallthomson authored Nov 15, 2023
2 parents fc6453a + 727e973 commit 157bc16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lab/cfn/eks-workshop-ide-cfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ Resources:
print('Instance is currently in state'.format(instance_state))
while instance_state != 'running':
time.sleep(5)
instance_state = ec2.describe_instances(InstanceIds=[instance_id])
print('Waiting for instance in state {}'.format(instance_state))
di = ec2.describe_instances(InstanceIds=[instance_id])
instance_state = di['Reservations'][0]['Instances'][0]['State']['Name']
print('Waiting for instance in state: {}'.format(instance_state))
print('Instance is ready')
Expand Down

0 comments on commit 157bc16

Please sign in to comment.