Jon Gallant

Solution to 'This value does not have any attributes.` with kubelet_identity.object_id

1 min read

Got this today when trying to assign access_policy to kubelet_identity

Terminal window
Error: Unsupported attribute
on main.tf line 59, in resource "azurerm_key_vault" "key_vault":
59: object_id = azurerm_kubernetes_cluster.aks.kubelet_identity.object_id
This value does not have any attributes.
```text
This fixed it:
```yaml
access_policy {
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = azurerm_kubernetes_cluster.aks.kubelet_identity.0.object_id
secret_permissions = ["get", "set", "list", "delete"]
}

Looks like kubelet_identity is a list, so you need an index 0 before object_id

Share:
Share on X