-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 Plan bases its add/change/destroy on the Terraform Resource name and not the Provider name #2766
Comments
Hi @SamirFarhat, Sorry that this is a problem for you. We have been aware of this issue for a while and are working on adding checks to all the resources to prevent it: #2773, #2728, #2664, #2592, #2537, #2518, #2511 These fixes will be enabled by default for all resources in |
@katbyte : What ARM_PROVIDER_STRICT=true will do. Will it fix my issue ? |
@SamirFarhat, when Once 2.0 is released this will be the default behaviour. |
Please see #2807 for more information @SamirFarhat. |
hey @SamirFarhat Just to add a little more context to what @katbyte has said: there's a difference in the way that Terraform tracks resource uniqueness and that Azure tracks resource uniqueness. Terraform handles this using the
in the example above Terraform will complain at Azure on the other hand generally uses the In v2.0 we're planning on fixing this behaviour by checking with the Azure API prior to creating the resource and confirming whether or not it exists. This behaviour is supported by the AzureRM Provider in the next version (v1.22) however will be feature-toggled off - you'll be able to opt-into this using the Environment Variable documented above. Since this behaviour's been fixed (but is feature-toggled off) - I'm going to close this issue in favour of #2807 where this will be feature-toggled on; however in the interim you should be able to set the Environment Variable Thanks! |
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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
This has been released in version 2.0.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.0.0"
}
# ... other configuration ... |
This issue was originally opened by @SamirFarhat as hashicorp/terraform#20118. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Expected Behavior
kv3.tf and kv4.tf contains the same data, th only differences are:
The Expected behavior is that Terraform stops me or tells me that the same resource will be created then overwritten
Actual Behavior
Terraform plan shows 2 resources to be added
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
azurerm_key_vault.icoma3
id:
location: "westeurope"
name: "kvtest01samirtest11"
resource_group_name: "test-terraform"
sku.#: "1"
sku.0.name: "standard"
tags.%:
tenant_id: "3a7fd4f8-30d9-4937-8015-7e20960a52f3"
vault_uri:
azurerm_key_vault.icoma4
id:
location: "westeurope"
name: "kvtest01samirtest11"
resource_group_name: "test-terraform"
sku.#: "1"
sku.0.name: "standard"
tags.%: "10"
tags.Envidronment: "goliath"
tags.Environment: "goliath"
tags.dfdfd: "gthshs"
tags.dfdfdd: "gthshs"
tags.houya: "rora"
tags.houyda: "rora"
tags.nedrmwnew: "yes yes"
tags.nedw: "yes"
tags.new: "yes"
tags.newnew: "yes yes"
tenant_id: "3a7fd4f8-30d9-4937-8015-7e20960a52f3"
vault_uri:
Plan: 2 to add, 0 to change, 0 to destroy.
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
terraform init
terraform plan
The text was updated successfully, but these errors were encountered: