-
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_key_vault_key not working for azurerm_key_vault_managed_hardware_security_module #13606
Comments
hi @schmaxe As mentioned in #12403, unfortunately this is a configuration issue and not a bug in Terraform - you need to specify the Resource ID of the Key Vault and not of the Managed HSM - which is what this validation is highlighting, as such you'll need to specify the correct Resource ID here for this to work. Since this is a configuration question rather than a bug in the Azure Provider I'm going to close this issue for the moment, but should you have further configuration questions I'd point you towards the community Discuss forum. Thanks |
@tombuildsstuff After using this field as key_vault_id I got the following error: Best regards |
How is this not a bug or a missing feature? The azurerm_key_vault_key parses the given key_vault_id here:
The resource id of a managed hsm contains "managedHSMs" instead of "vaults", which would be correctly parsed with the managed_hsm parser here:
Hence there is currently no way to create a key within a managed hsm via the provider as there is neither a "azurerm_managed_hsm_key" resource nor an abstraction layer within azurerm_key_vault_key that would differentiate between a key_vault_id and a managed_hsm_id. |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm v2.79.1
Terraform Configuration Files
Debug Output
╷
│ Error: ID was missing the
vaults
element│
│ with azurerm_key_vault_key.key,
│ on main.tf line 4, in resource "azurerm_key_vault_key" "key":
│ 4: key_vault_id = var.key_vault_id
│
╵
ERRO[0018] Hit multiple errors:
Hit multiple errors:
exit status 1
Panic Output
Expected Behaviour
Creation of the Key inside the Managed HSM
Actual Behaviour
Key wont be created because of a key vault id check that it contains ".../vaults/.."
But the Managed HSM ID looks like "..providers/Microsoft.KeyVault/managedHsm/.."
Steps to Reproduce
Important Factoids
References
#12403 was the same problem but got closed
Newer azurerm version and problem still exists
@tombuildsstuff @katbyte
The text was updated successfully, but these errors were encountered: