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
feita há 4 anos1841 visualizações
1 Resposta
0
Resposta aceita

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
respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas