-
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
azurerm_storage_account_customer_managed_key: support for key vaults in other subscriptions #24385
Comments
@MattGarnerAWR Currently, the code assumes the subscription id of the keyvault is the same as the storage account id: Lines 274 to 284 in 5273496
As the provider currently is designed to work within one subscription, I regard this issue as an enhancement. |
@magodo I disagree, this goes against provider design principles. This should be a bug. https://developer.hashicorp.com/terraform/plugin/best-practices/hashicorp-provider-design-principles |
@tombuildsstuff This issue seems to be a regression introduced by #24019. |
I'm agree with @MattGarnerAWR whenever you do a # module.storage_account.azurerm_storage_account.storage_account will be updated in-place
~ resource "azurerm_storage_account" "storage_account" {
id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Storage/storageAccounts/mystorageaccount"
- customer_managed_key {
- key_vault_key_id = "https://myvault.vault.azure.net/keys/my-key" -> null
- user_assigned_identity_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mystorageaccount-blob-id" -> null
}
# (5 unchanged blocks hidden)
} And the Plan: 0 to add, 1 to change, 0 to destroy.
module.storage_account.azurerm_storage_account.storage_account: Modifying... [id=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Storage/storageAccounts/mystorageaccount]
module.storage_account.azurerm_storage_account.storage_account: Modifications complete after 5s [id=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Storage/storageAccounts/mystorageaccount] |
As @magodo has mentioned above, this is an enhancement request rather than a bug - since we have a 1:1 relationship between a Provider instance and a Subscription at this point-in-time. Since there's already an issue open for this I'm going to consolidate this issue into #20199, as such would you mind subscribing to that issue for updates? 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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.6.0
AzureRM Provider Version
3.85.0
Affected Resource(s)/Data Source(s)
azurerm_storage_account_customer_managed_key
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
TF plan should find no changes, as CMK is already set up on the storage account
Actual Behaviour
Every TF plan is wanting to apply the key vault ID to the storage account CMK.
Steps to Reproduce
Important Factoids
Key Vault is not on the same subscription, not sure if that is a problem?
References
No response
The text was updated successfully, but these errors were encountered: