-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
"Know ahead of time" that create_before_destroy won't work in certain situations (Feature request) #6812
Comments
Hi @cjcjameson 👋 Your Terraform configuration has the following: lifecycle {
create_before_destroy = 1
ignore_changes = ["tags.Creator"]
} The documentation for Since the resource is explicitly configured to create before destroy, you will need to remove that lifecycle configuration to change the graph ordering or consider one of the following which are compatible with
Hope this helps. |
Oh darn. What's that doing there? I thought it was on a different stanza but I put it in the wrong place. 🤦♂️ sorry about that! |
@bflad wait! Can I convert this into a feature request?!? Terraform "should" "know" that create_before_destroy won't work when the name stays the same for this type of resource. The error message could show this explanation! |
Anything within resource |
@bflad good call, thank you! https://github.com/hashicorp/terraform/issues/19631 |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/cjcjameson/b430e1b7fc4a196538831a5d40eb7567
Expected Behavior
terraform plan
plans for a destruction and recreation. Although this is annoying that changing a security group'sDescription
means you have to recreate, it's consistent with the explanation given in the docs and in AWS CloudFormationThe security group should have been destroyed, and then new security group created.
Actual Behavior
Terraform tried to create the security group first, but because the name is the same as it was before (only the description had changed)
The code at https://github.com/terraform-providers/terraform-provider-aws/blob/dacf0b4c8a8bd4b6d4fd1b6aa5618f72939121a7/aws/resource_aws_security_group.go#L58-L64 is correct, it seems. So maybe it's a graph issue?
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: