Open rranjan82 opened 1 year ago
@rranjan82 From the error message:
17:46:03 Error: Provider produced inconsistent final plan 17:46:03
17:46:03 When expanding the plan for 17:46:03 module.storage_account_syn.azurerm_storage_account.storage_account to include 17:46:03 new values learned so far during apply, provider 17:46:03 "registry.terraform.io/hashicorp/azurerm" produced an invalid new value for 17:46:03 .network_rules[0].ip_rules: length changed from 90 to 91.
It appears that the ip_rules
you've set in the module input by var.syn_ip_access_list
is of length 90, while after the apply, it reads 91 ip_rules
from Azure. It mostly because you are mixing azurerm_storage_account_network_rules
and the network_rules
in azurem_storage_account
. See the highlight at the begining of the document of the azurerm_storage_account_network_rules
:
Network Rules can be defined either directly on the azurerm_storage_account resource, or using the azurerm_storage_account_network_rules resource - but the two cannot be used together. Spurious changes will occur if both are used against the same Storage Account.
And:
Only one azurerm_storage_account_network_rules can be tied to an azurerm_storage_account. Spurious changes will occur if more than azurerm_storage_account_network_rules is tied to the same azurerm_storage_account.
Thanks!. I have updated the code to have one IP rule.
Now it is atleast trying to enable customer key but after 7 minutes, it fails with below error. Any idea why?
02:27:17 module.storage_account_syn1.azurerm_storage_account_customer_managed_key.storage_encryption[0]: Still creating... [7m0s elapsed]
02:27:25 module.storage_account_syn1.azurerm_storage_account_customer_managed_key.storage_encryption[0]: Still creating... [7m10s elapsed]
02:27:35 module.storage_account_syn1.azurerm_storage_account_customer_managed_key.storage_encryption[0]: Still creating... [7m20s elapsed]
02:27:45 module.storage_account_syn1.azurerm_storage_account_customer_managed_key.storage_encryption[0]: Still creating... [7m30s elapsed]
02:27:49
02:27:49 Error: updating Customer Managed Key for Storage Account "ihubpocsynsandboxsa1" (Resource Group "ihub-poc-syn-sandbox-rg"): storage.AccountsClient#Update: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="GatewayAuthenticationFailed" Message="Gateway authentication failed for 'Microsoft.Storage'. Diagnostic information: timestamp '20230627T062347Z', tracking id '7ce8b20f-2c48-48db-9573-3fc5a1818520', request correlation id '07d6fc91-61aa-5076-8d91-df77691ec442'."
02:27:49
02:27:49 with module.storage_account_syn1.azurerm_storage_account_customer_managed_key.storage_encryption[0],
02:27:49 on ../../templates/modules/storage/storage_account/v1/storage_account_main.tf line 497, in resource "azurerm_storage_account_customer_managed_key" "storage_encryption":
02:27:49 497: resource "azurerm_storage_account_customer_managed_key" "storage_encryption" {
Is there an existing issue for this?
Community Note
Terraform Version
1.4.6
AzureRM Provider Version
3.60.0
Affected Resource(s)/Data Source(s)
azurerm_storage
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Expectation is that, customer manage key should get enabled for storage account.
Actual Behaviour
terraform plan is working fine. terraform apply is failing.
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response