Hello, I’m fairly new to terraform but learning quickly. Our terraform project passes validation but on “plan” I get the following error:
Error: Attempt to get attribute from null value
on modules/cognitive-account/key-vault-key.tf line 3, in resource “azurerm_key_vault_key” “cognitive_account_key_vault_key”:
3: key_vault_id = local.cognitive_account.cognitive_account_key_vault_key.key_vault_id
├────────────────
│ local.cognitive_account.cognitive_account_key_vault_key is null
This value is null, so it does not have any attributes.
Error: Attempt to get attribute from null value
on modules/cognitive-account/key-vault-key.tf line 4, in resource “azurerm_key_vault_key” “cognitive_account_key_vault_key”:
4: key_type = local.cognitive_account.cognitive_account_key_vault_key.key_type
├────────────────
│ local.cognitive_account.cognitive_account_key_vault_key is null
This value is null, so it does not have any attributes.
cognitive_account_key_vault_key should be an object based on tfvars. I’ve made the modules available on github: GitHub - freyesicp/angry-aardvark-tf-cognitive-account
Why would cognitive_account_key_vault_key be empty?