hashicorp/vault-guides

Error: "access_policy.0.object_id" isn't a valid UUID on terraform plan on azure-keyvault-unseal

mzarglis opened this issue · 4 comments

`Error: "access_policy.0.object_id" isn't a valid UUID (""): uuid string is wrong length

on main.tf line 20, in resource "azurerm_key_vault" "vault":
20: resource "azurerm_key_vault" "vault" {`

@mzarglis I was able to run the Terraform successfully. (I'm assuming that you're talking about the azure-keyvault-unseal assets.)

I've tested this with Terraform v0.12.18 as well as v0.12.20 successfully.

I did some Google search and found this --> hashicorp/terraform-provider-azurerm#2901

It's not clear what they're suggesting, but you can try un-comment line 37 and comment-out line 38 and provide your object ID via terraform.tfvars file. (It seems that's what they've tried?)

p.s. I don't know if this has anything to do with the error you've received, but my app has Azure Active Directory Graph API permission attached. Though if the error was permission related, you should've received an error saying something about "permission" rather than invalid UUID error. :(

So upon further investigation i had to add subscription_id, client_id, client_secret, tenant_id under the azurerm provider block in main.tf to get this to work as expected.

Else terraform authenticates using Azure CLI authentication not the service principal and data.azurerm_client_config.current.service_principal_object_id returns the wrong UUID of the az cli authentication object and not the UUID of the service principal as expected.

or at least this is my understanding

I am have the same problem...

Error: expected "object_id" to be a valid UUID, got
on keyvault.tf line 62, in resource "azurerm_key_vault_access_policy" "purview_msi":
62: resource "azurerm_key_vault_access_policy" "purview_msi" {

using v0.13.3

It worked earlier.