I ve used the following AWS CLI Cloud Formation commands for create and then execute and change set:
aws cloudformation create-change-set --change-set-name change-set-1
aws cloudformation execute-change-set --change-set-name change-set-1
The problem is the first command returns before the change set is created, also if try I execute the second command immediately it fails.
I could come to terms with following possible solutions
- Adding a delay between the two commands.
- Repeating the second command until it succeeds.
Both have their problems.
Ideally there would be an option on the create-change-set command to execute immediately, or to run synchronously and not return until the change set has been created.
Is there a way to get a better solution?