Hi all,
I am facing difficulties auto-renewing an AppRole token using the vault Terraform provider.
The token expires after 20 seconds and doesn’t generate a new one.
Is something missing in the resources?
resource "vault_approle_auth_backend_role" "roles" {
for_each = local.policies
backend = vault_auth_backend.approle.path
role_name = "${each.key}-role"
token_policies = ["default", "${each.key}"]
bind_secret_id = true
token_period = 20
token_max_ttl = 0
token_explicit_max_ttl = 0
secret_id_ttl = 10
token_type = "default"
}
resource "vault_approle_auth_backend_role_secret_id" "id" {
for_each = local.policies
backend = vault_auth_backend.approle.path
role_name = "${each.key}-role"
}
resource "vault_approle_auth_backend_login" "login" {
for_each = local.policies
backend = vault_auth_backend.approle.path
role_id = vault_approle_auth_backend_role.roles[each.key].role_id
secret_id = vault_approle_auth_backend_role_secret_id.id[each.key].secret_id
}
Any hints/help would be appreciated.
Thank you,
Cheers