-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
azurerm_key_vault - does not persist change for network_acls on terraform site and reapplies same change on every run #2164
Comments
I'm encountering the same problem with
Which results in
Sounds like the same problem with a different resource. I don't know if this deserves another issue. |
@OwenGr thanks for reporting this - whilst this is related, would you mind opening a new issue for that? |
Had the same issue with ip rules within a network acl with single IPs. What solved my problem was to always add the netmask (so in address in cidr notation). So for example if you want to add the ip address |
@r0bnet solution works. Thanks! |
Hi, Having same issue when deploying Key Vault and using
Really need to don't have this update on each run. Thanks, |
I am still having this issue. It got fixed in Key vault, but still, an issue with a storage account."DefaultAction": "Allow" getting policy violation issue.Error : "DefaultAction": "Deny" getting network acls validation failure.{ Plesae check below template code, which I am trying to execute : ` please let me know if anyone found a fix for it. I am using VSTS CI/CD Pipeline |
Any updates on this? Would love to stop seeing these in all of my plans. |
Problem is, when Example: run resource "azurerm_key_vault" "test_kv" {
name = "test-kv"
...
network_acls {
default_action = "Allow"
bypass = "AzureServices"
}
} Then run {
"id": "/subscriptions/******/resourceGroups/*****/providers/Microsoft.KeyVault/vaults/***",
"location": "eastus2",
"name": "***",
"properties": {
....
"networkAcls": null,
"provisioningState": "Succeeded",
"sku": {
"name": "premium"
},
"tenantId": "****",
"vaultUri": "https://****.vault.azure.net/"
},
"resourceGroup": "****",
"tags": {},
"type": "Microsoft.KeyVault/vaults"
} I'll probably going to raise a PR to fix this. |
Initial PR attempt made to fix the issue: #4805 . Might want to add some tests for this. |
@richardzone
Where it's just creating new records in place. Will this be solved then as well? |
This PR supersedes #4805 by making the network_acls block computed with a default value based on the behaviour of the API $ acctests azurerm TestAccAzureRMKeyVault_networkAcls === RUN TestAccAzureRMKeyVault_networkAcls === PAUSE TestAccAzureRMKeyVault_networkAcls === RUN TestAccAzureRMKeyVault_networkAclsAllowed === PAUSE TestAccAzureRMKeyVault_networkAclsAllowed === CONT TestAccAzureRMKeyVault_networkAcls --- PASS: TestAccAzureRMKeyVault_networkAcls (347.28s) === CONT TestAccAzureRMKeyVault_networkAclsAllowed --- PASS: TestAccAzureRMKeyVault_networkAclsAllowed (247.89s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 595.221s Fixes #2164
This has been released in version 1.40.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 = "~> 1.40.0"
}
# ... other configuration ... |
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 👉 hashibot-feedback@hashicorp.com. Thanks! |
azurerm_key_vault - do not persist change for network_acls on terraform site and reapplies same change on every run
Community Note
Terraform Version
Terraform v0.11.10
Affected Resource(s)
azurerm_key_vault
Terraform Configuration Files
Debug Output
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ azurerm_key_vault.test_kv
network_acls.#: "0" => "1"
network_acls.0.bypass: "" => "AzureServices"
network_acls.0.default_action: "" => "Allow"
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
azurerm_key_vault.test_kv: Modifying... (ID: /subscriptions/../Microsoft.KeyVault/vaults/test-raf-kv)
network_acls.#: "0" => "1"
network_acls.0.bypass: "" => "AzureServices"
network_acls.0.default_action: "" => "Allow"
azurerm_key_vault.test_kv: Modifications complete after 1s (ID: /subscriptions/.../Microsoft.KeyVault/vaults/test-raf-kv)
Expected Behavior
Once applied terraform should indicate that there will be 0 changes.
Actual Behavior
it applies this change et every run even tough its already reflected on azure site.
Important Factoids
When I comment out network_acls { block the terraform stops reapplying it but it must be done after I run following at least once
network_acls {
default_action = "Allow"
bypass = "AzureServices"
}
Ideally to remove all my network acl change I would like to simply comment out network_acls { but its currently not the case as terraform doesn't perform any change at that point.
The text was updated successfully, but these errors were encountered: