aws-ia / taskcat

Test all the CloudFormation things! (with TaskCat)
https://aws-ia.github.io/taskcat/
Apache License 2.0
1.17k stars 213 forks source link

Add Cloudformation waiter to delete operation #811

Closed gcasilva closed 1 year ago

gcasilva commented 1 year ago

Overview

Includes Cloudformation waiter for the delete operation. This is needed when we have a use-case to deploy sequential executions of Taskcat that leverages same set of resources as this could cause conflicts. This is explained in this Issue: https://github.com/aws-ia/taskcat/issues/809

Testing/Steps taken to ensure quality

Tested successfully Taskcat sequential deployment using this forked version

Notes

Optional. Caveats, Alternatives, Other relevant information.

Testing Instructions

How to test this PR Start after checking out this branch (bulleted)

gattasrikanth commented 1 year ago

Do you think an extra flag is needed to wait? For our usecase this is perfect without any flags. Right now we trigger a clean, a custom script wait for all the stacks tobe deleted and then run clean up resources to delete any leftover s3buckets/dynamodb etc.

But what if someone wants to just trigger the delete taskact test clean project_name and move on to next steps in the CI/CD without having to wait for the stacks tobe deleted completely in all regions. It might be a deal breaker for such usecases.

I guess something like this will be useful. taskcat test clean project_name --wait-for-stacks-delete

Any thoughts?

gcasilva commented 1 year ago

@gattasrikanth That's a good point, will work on modifying this implementation so user can send it as a parameter like you suggested: taskcat test clean project_name --wait-for-stacks-delete

andrew-glenn commented 1 year ago

@gcasilva Thank you so much for this PR; I'm flipping it to draft while you add the flag; flip it to "ready" when you're... ready :)

gcasilva commented 1 year ago

@andrew-glenn @gattasrikanth made the change to last commit so that if user does not add argument -w or --wait-for-delete on test clean it will behave as is today (without waiting for cloudformation deletion to complete), but if they add the argument -w then taskcat will wait for cloudformation deletion to complete before proceeding. Tested successfully here. Can you please review it?