How can I fix Unknown token: vault_auth_backend.approle.path

145 views Asked by At

So there's this tutorial page on terraform about vault_approle_auth_backend_role:

resource "vault_auth_backend" "approle" {
  type = "approle"
}

resource "vault_approle_auth_backend_role" "example" {
  backend        = vault_auth_backend.approle.path
  role_name      = "test-role"
  token_policies = ["default", "dev", "prod"]
}

But when I copy the sample code and try to run terraform init there's an error:

Unknown token: vault_auth_backend.approle.path

How can I fix it?

I noticed that backend parameter is optional, can I just skip it? I feel like I'd like to set its value to $VAULT_ADDR/v1/identity/oidc/role or something.

If I use backend = "${vault_auth_backend.approle.path}", it still shows backend: "${vault_auth_backend.approle.path}" when running terraform plan.

0

There are 0 answers