You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You end up waiting a long time, and getting a failure for a naming conflict. You know that there's a naming conflict. Maybe you temporarily don't care about create_before_destroy, or maybe you want to be alerted specifically that's why there's a conflict.
Attempted Solutions
The workaround is to temporarily not create-before-destroy, or manually destroy and then recreate with terraform...
Proposal
I think providers would need to add a boolean to the schema elements, something like must_change_to_create_before_destroy
Hi @cjcjameson
This is a good idea, but Terraform currently has no way of identifying unique resources in general, which is an important prerequisite for such feature.
This feature is tracked under #224 and I expect that reporting ID conflicts in planning stage would be one of the main use cases. I will close this issue as a duplicate of #224 which will also link it from there, so we won't loose the important context, but it will allow us to keep relevant discussion in one place.
You also mentioned that in AWS specifically you had to wait until seeing a relevant error. This may be because the underlying API isn't designed to handle certain situations - e.g. it exposes a single endpoint for both creating and updating the resource, i.e. it does not error out when a resource of the same name already exists.
Relatedly #101 describes how we might allow providers to perform early "enhanced" validation (such as checking whether name of a resource is available) in the future.
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
locked and limited conversation to collaborators
Mar 30, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Terraform Version
11.10
Use-cases
A resource is labelled
create_before_destroy
A attribute of that resource requires recreating that resource to be applied
But the "name" of that resource in the IaaS doesn't change, and there will be a conflict from the IaaS when trying to create before destroying.
hashicorp/terraform-provider-aws#6812
You end up waiting a long time, and getting a failure for a naming conflict. You know that there's a naming conflict. Maybe you temporarily don't care about create_before_destroy, or maybe you want to be alerted specifically that's why there's a conflict.
Attempted Solutions
The workaround is to temporarily not create-before-destroy, or manually destroy and then recreate with terraform...
Proposal
I think providers would need to add a boolean to the schema elements, something like
must_change_to_create_before_destroy
https://github.com/terraform-providers/terraform-provider-aws/blob/d609b1f599625d0b1d0a8f219f8bbf37e16a1ceb/aws/resource_aws_security_group.go#L41-L48
References
hashicorp/terraform-provider-aws#6812
The text was updated successfully, but these errors were encountered: