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
preguntada hace 4 años1841 visualizaciones
1 Respuesta
0
Respuesta aceptada

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 hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas