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

providers/aws: aws_autoscaling_group -/+ should wait till scaling group is removed before recreating #1105

Closed
pmoust opened this issue Mar 3, 2015 · 5 comments · Fixed by #1353
Assignees

Comments

@pmoust
Copy link
Contributor

pmoust commented Mar 3, 2015

@catsby since taint command has been introduced I wanted to utilize it to iterate through some changes fast on our ASGs.

Terraform v0.4.0-dev (23d90c0c02c10596eed79986e356b20bc6abb441)

 ~/pph/pph-iac/peopleperhour ⮀ ⭠ master  ⮀ terraform taint aws_autoscaling_group.micro_staging
The resource aws_autoscaling_group.micro_staging in the module root has been marked as tainted!
 ~/pph/pph-iac/peopleperhour ⮀ ⭠ master ● ⮀ terraform plan -out /tmp/plan
<snipped>
-/+ aws_autoscaling_group.micro_staging
<snipped>
 ~/pph/pph-iac/peopleperhour ⮀ ⭠ master ● ⮀ terraform apply /tmp/plan
aws_autoscaling_group.micro_staging: Destroying...
aws_autoscaling_group.micro_staging: Creating... 
<snipped>
aws_autoscaling_group.micro_staging: Error: 1 error(s) occurred:

* Error creating Autoscaling Group: AutoScalingGroup by this name already exists - A group with the name micro_staging already exists and is pending delete.  Please wait until Autoscaling completes the deletion process before creating another group with the same name.

I 'd like TF to wait until the aws_autoscaling_group no longer exists before attempting to recreate it. It can take a while since instances need to be terminated first by the ASG scheduler.

@catsby
Copy link
Contributor

catsby commented Mar 31, 2015

@pmoust odd, the ASG resource is supposed to drain the instances before attempting to delete the ASG itself, so this shouldn't be an issue. If you have a sample config around that would help, otherwise I'll try to reproduce this on my own.
Thanks!

@catsby
Copy link
Contributor

catsby commented Mar 31, 2015

I've reproduced this, digging in more...

@catsby catsby self-assigned this Mar 31, 2015
@catsby
Copy link
Contributor

catsby commented Mar 31, 2015

This is a timing problem, in that there's a brief window of time when the ASG has a status of "Delete in progress" after we issue the API call to delete it. We're not giving it enough time to complete the deletion before we try to re-create it.

I'm looking into what we can do here. It's simple enough to poll for a successful deletion here before moving on, but that would likely block in every other scenario where it might not be necessary to wait.

@catsby
Copy link
Contributor

catsby commented Apr 1, 2015

@pmoust this should be fixed in #1353

@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

Successfully merging a pull request may close this issue.

3 participants