Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add destroyCf goal that deletes CloudFormation stack. #19

Merged
merged 4 commits into from
Jul 10, 2020

Conversation

maciejwalkowiak
Copy link
Contributor

I would like to use this plugin for running integration tests, where in pre-integration-test phase stack is created and in post-integration-test stack is destroyed.

This PR adds a goal to destroy CloudFormation stack.

long t = System.currentTimeMillis();

while (true) {
List<Stack> stacks;
try {
stacks = cloudFormationClient.describeStacks(describeRequest).getStacks();
} catch (AmazonCloudFormationException e) {
log.warn(e.getMessage());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you removed the warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When stack is destroyed, in my tests it always throws exception here saying that stack is not found - being a bit misleading because this is exactly what was meant to happen. Perhaps it could be changed to info?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info sounds fine if you could make that change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Owner

@davidmoten davidmoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution!

@davidmoten davidmoten merged commit bd07dcd into davidmoten:master Jul 10, 2020
@davidmoten
Copy link
Owner

I've deployed this change to Maven Central in 0.2.26.

@maciejwalkowiak
Copy link
Contributor Author

Fantastic, thank you!

@maciejwalkowiak maciejwalkowiak deleted the destroyCf-goal branch July 10, 2020 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants