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

provider/aws: Handle all kinds of CloudFormation stack failures #5606

Merged
merged 2 commits into from
Sep 3, 2016

Conversation

radeksimko
Copy link
Member

This fixes #5559 (specifically cb4c2a9) and attempts to fix #5487 (It is fixing an unreported bug which became clear as part of that issue).

Explanation

I'm treating this as WIP because I have asked AWS support for advice on how to catch reasons behind deleted stacks when user specifies OnFailure=DELETE reliably and I may modify this PR based on their response.

In worst case I'll most likely send another PR to introduce something like MaxRetry into resource.StateChangeConf which would allow me locally reducing this from hard-coded 10 seconds (if it's reached via exponential backoff) to 1 second (or something like that) at the risk of potentially being throttled by API limits, but reducing the risk of missing events that contain reasons for stack deletion.

In theory you could say that CloudFormation is slow enough that going from CREATE_IN_PROGRESS over DELETE_IN_PROGRESS to be gone should take more than 10 seconds, but it may not always be the case.

Test plan

make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSCloudFormation'

@radeksimko
Copy link
Member Author

I have received response from AWS support - there seems to be a fairly clean (yet slightly confusing) solution.

If Stack ID (instead of stack name) is passed as a value of an argument StackName in DescribeStackEvents, it should be possible to query events of deleted stacks too.

I will update the PR soon.

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Mar 23, 2016
@darnould
Copy link

Just encountered this issue, glad to see it's already been identified and in the process of being addressed.

Anything I can do to help drive this forward? Would be good to get this out.

@stack72
Copy link
Contributor

stack72 commented Jul 15, 2016

@radeksimko is this is a place to test right now?

@radeksimko radeksimko force-pushed the b-cloudformation-fixes branch 6 times, most recently from c31ef5a to 4e90fc6 Compare August 29, 2016 10:05
 - Use ID instead of stack name per AWS' advice
 - Query failures/errors *after* the stack has reached target state
@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Aug 29, 2016
@radeksimko radeksimko changed the title [WIP] provider/aws: Handle deleted CloudFormation stacks gracefully provider/aws: Handle deleted CloudFormation stacks gracefully Aug 29, 2016
@radeksimko radeksimko changed the title provider/aws: Handle deleted CloudFormation stacks gracefully provider/aws: Handle all kinds of CloudFormation stack failures Aug 29, 2016
@radeksimko
Copy link
Member Author

@stack72 This is now finally ready for review. Sorry for such a long delay.

Test plan

https://gist.github.com/radeksimko/961c544ab114b72c665392ed4b2ce786

@stack72
Copy link
Contributor

stack72 commented Sep 3, 2016

Hi @radeksimko

Been through this tonight and it looks good to me :)

P.

@stack72 stack72 merged commit b829032 into hashicorp:master Sep 3, 2016
@radeksimko radeksimko deleted the b-cloudformation-fixes branch September 4, 2016 06:57
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants