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

aws/asg: Wait for scaling activities before deleting #1512

Closed
radeksimko opened this issue Apr 13, 2015 · 6 comments
Closed

aws/asg: Wait for scaling activities before deleting #1512

radeksimko opened this issue Apr 13, 2015 · 6 comments

Comments

@radeksimko
Copy link
Member

Sometimes I end up with and error trying to destroy an ASG:

You cannot delete an AutoScalingGroup while there are scaling activities in progress for that group.

I guess you can simulate that state by manually changing "desired count" in the web console and then immediately trigger terraform destroy.

I believe that Terraform should try at least couple times and wait some time until ASG finishes these scaling activities and then destroy the ASG.

@phinze
Copy link
Contributor

phinze commented Apr 13, 2015

I wonder if it's actually more appropriate for TF to actually pause and resume scaling operations when making changes to ASGs. That's what most bespoke tooling I've worked with does, and it seems pretty reasonable.

https://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html

What do you think @radeksimko?

@radeksimko
Copy link
Member Author

Hmmm, I didn't know it's actually possible, thanks for teaching me something new! 👍 😃
It is probably the best solution as long as the API call is synchronous.

i.e. if there's scaling activity in progress, it either waits until that activity finishes and then puts the lock in place that will prevent any further activities to occur OR it just suspends whatever's happening (which would bring another question -> if I'm bringing up a new instance during that autoscaling activity, what happens with that one? is it terminated?)

In simple terms - can that API call to "suspend" auto scaling processes fail?

@phinze
Copy link
Contributor

phinze commented Apr 13, 2015

Yeah good question. Going over the docs it seems like it's generally expected to succeed, which makes me feel like it's only going to suspend future operations. We'd have to do a little testing to see if the effect takes place immediately and what the edge cases might be.

@woodhull
Copy link

+1 calling suspend when Terraform operations are in progress on ASGs seems like the correct behavior.

@radeksimko
Copy link
Member Author

Fixed via #1840

@ghost
Copy link

ghost commented May 3, 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 May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants