-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
fails to destroy asg #176
Comments
Cool, then problem solved, right? If you want to enable |
That is not very satisfying. A plan that can not be destroyed seems defective. Deploying the cluster with it enable and then doing an update to disable and then trying the destroy also fails. If this is as designed and not a bug, I think a more descriptive on the functionality and impact would be helpful. Thanks. |
Just hit this and this is not a behavior I expected. What's the best way we could do this? How are you all handling this problem? The best way I can think of is adding a local-exec or remote-exec provisioner with |
Hi, We have another module wrapping this module and @bmihaescu created the workaround I mentioned above: resource "null_resource" "eks-predestroy" {
provisioner "local-exec" {
when = "destroy"
interpreter = ["/bin/bash", "-c"]
command = <<CMD
ASGName=$(aws autoscaling describe-auto-scaling-groups | grep "${local.cluster_name}" -A 100 -B 100 | grep AutoScalingGroupName | tr -d '" ,' | cut -f2 -d ":")
for asg in $ASGName; do
InstanceID=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name "$asg" | grep InstanceId | tr -d '" ,' | cut -f2 -d ":")
for instance in $InstanceID; do
aws autoscaling set-instance-protection --instance-ids "$instance" --auto-scaling-group-name "$asg" --no-protected-from-scale-in
done
done
CMD
}
} It's a bit crude and could be converted to use LE: aaaand due to hashicorp/terraform#13549 this only works on |
This is totally 100% "working as intended". If you set |
Changing the |
Exactly. You can't have it both ways. |
Given how many folks have encountered this, I'd like the developers to reconsider. I see at least three arguments for being able to destroy ASGs declared with
Given these three arguments -- and the many duplicate requests / confusions in this and related threads -- I ask the authors to reconsider the viewpoint above. The existing behavior might be matching the AWS semantics 1-to-1, but that's arguably less useful than adopting the viewpoints I give earlier -- and isn't Terraform all about making AWS more useful? If the authors think that this kind of one-way switch / extra protection is valuable, maybe adopt some other mechanism? |
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. |
I have issues
More than what will be helped here ... The terrafrom-aws-eks module fails to destroy.
I'm submitting a...
What is the current behavior?
terraform destroy
exits non-zero :If this is a bug, how to reproduce? Please include a code sample if relevant.
Apply a plan with the following module config:
Then attempt to
terraform destroy
What's the expected behavior?
That
terraform destroy
successfully deletes the asg and exits 0.Are you able to fix this problem and submit a PR? Link here if you have already.
Willing to help, but could use some direction pinpointing the issue.
Environment details
Any other relevant info
protect_from_scale_in = true
seems to be the culprit. If I provision without it, I can successfully destroy.The text was updated successfully, but these errors were encountered: