-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Terraform fails to destroy autoscaling group if scale in protection is enabled #5278
Comments
@erikselin Does |
Hi @erikselin 👋 Given that Terraform is designed to be declarative, it seems like the behavior you're expecting conflicts with itself:
Since As @tomelliff mentioned above,
Perhaps a better ask here then may be to add logic into the Terraform resource that errors out immediately if |
@bflad what about setting It does feel a bit odd but if people want to protect Terraform from destroying the ASG then I think they should really be using Also I'm a little unsure about that comment in the docs on
which should mean that all resources are cleaned up properly. It could be that that's not actually the case though :/ |
@bflad I think the error logic might actually be a great solution here. If I had received an actionable error message explaining the issue instead of a timeout error after 10 minutes I don't think I would have opened an issue or consider this a bug :) |
@tomelliff is correct in my opinion. Scale in protection is different from "I don't need this anymore, please delete it". In the absence of literally anything else, an error would be helpful, but that requires human intervention to remove scale in protection, which negates the entire point of terraform. |
This issue is also being hit in the EKS module: terraform-aws-modules/terraform-aws-eks#176 and I am currently thinking of workarounds. The idea I had was to use a local-exec or remote-exec provisioner with |
any update on this? I'm still hitting this issue with terraform 0.12.28 and aws provider 2.70. |
Seems the issue is still not resolved. Please let me know if i am missing anything here. This is kind of pain on destroying the ASG by using terraform destroy :( module.nlb-asg.module.asg.aws_autoscaling_group.asg[0]: Still destroying... [id=SYDMED-DEV1-asg, 9m20s elapsed] |
For what it is worth, I am still facing this issue on Terraform Versionterraform --version
Terraform v0.13.5 In particular, it looks like even with both resource "aws_autoscaling_group" "ecs_cluster" {
# other settings...
# (force_delete) NOTE! see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#force_delete
force_delete = true
protect_from_scale_in = false
} Related IssuesA possible related issue seems to be that the WorkaroundUsing |
Still an issue on:
|
Hi all 👋 Just letting you know that this is issue is featured on this quarters roadmap. If a PR exists to close the issue a maintainer will review and either make changes directly, or work with the original author to get the contribution merged. If you have written a PR to resolve the issue please ensure the "Allow edits from maintainers" box is checked. Thanks for your patience and we are looking forward to getting this merged soon! |
I'm planning to take a look at this after 4.0 is released. |
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. |
This issue was originally opened by @erikselin as hashicorp/terraform#18507. It was migrated here as a result of the provider split. The original body of the issue is below.
Relates #11409
Terraform Version
Terraform Configuration Files
Crash Output
Expected Behavior
Terraform should have terminated the instances associated with the aws_autoscaling_group and then destroyed the aws_autoscaling_group.
Actual Behavior
protect_from_scale_in = true
.Steps to Reproduce
protect_from_scale_in = true
.The text was updated successfully, but these errors were encountered: