Skip to content

Commit

Permalink
update kubernetes output creds based on azure rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusdc committed Dec 16, 2024
1 parent 404eea3 commit aaadaa7
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
output "credentials" {
description = "Credentials required for connecting to kubernetes cluster"
description = "Credentials required for connecting to Kubernetes cluster"
sensitive = true
value = {
# see bottom of https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster
endpoint = azurerm_kubernetes_cluster.main.kube_config.0.host
username = azurerm_kubernetes_cluster.main.kube_config.0.username
password = azurerm_kubernetes_cluster.main.kube_config.0.password
client_certificate = base64decode(azurerm_kubernetes_cluster.main.kube_config.0.client_certificate)
client_key = base64decode(azurerm_kubernetes_cluster.main.kube_config.0.client_key)
cluster_ca_certificate = base64decode(azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate)
endpoint = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.host : azurerm_kubernetes_cluster.main.kube_config.0.host
username = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.username : azurerm_kubernetes_cluster.main.kube_config.0.username
password = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.password : azurerm_kubernetes_cluster.main.kube_config.0.password
client_certificate = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.client_certificate : azurerm_kubernetes_cluster.main.kube_config.0.client_certificate
client_key = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.client_key : azurerm_kubernetes_cluster.main.kube_config.0.client_key
cluster_ca_certificate = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config.0.cluster_ca_certificate : azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate
}
}

output "kubeconfig" {
description = "Kubernetes connection kubeconfig"
sensitive = true
value = azurerm_kubernetes_cluster.main.kube_config_raw
value = var.azure_rbac.enable ? azurerm_kubernetes_cluster.main.kube_admin_config_raw : azurerm_kubernetes_cluster.main.kube_config_raw
}

output "cluster_oidc_issuer_url" {
Expand Down

0 comments on commit aaadaa7

Please sign in to comment.