Deleting CloudFormation Stacks using a shell script

0

I am writing a shell script to delete a handful stacks using the cli command "aws cloudformation delete-stack --stack-name <stack1>".

When I try to delete the stacks one after the other, only the first one gets deleted and ignores the subsequent stacks. This behavior is precisely same as the management console.

I tried to run each command as a background process in the shell script but the result is still the same. When I delete the stacks one after the other in command prompt it worked fine.

Any thoughts/pointers are appreciated.

AWS
demandé il y a 4 ans1841 vues
1 réponse
0
Réponse acceptée

The solution to this issue is to use Cloudformation's "wait". I have resolved this issue by using "aws cloudformation wait stack-delete-complete --stack-name "$stack" after every stack delete. This works fine within a shell script if you have to delete more than one CloudFormation stack.

AWS
répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions