Skip to content

Commit

Permalink
feat: add cluster credentials output
Browse files Browse the repository at this point in the history
  • Loading branch information
KoLiBer committed Mar 6, 2024
1 parent 015ecad commit f116950
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ output "port" {
description = "Cluster Port"
}

output "kubeconfig" {
output "config" {
value = try(ssh_sensitive_resource.kubeconfig[0].result, null)
sensitive = true
description = "Cluster Kubernetes Config"
description = "Cluster Config"
}

output "client_key" {
value = try(base64decode(yamldecode(ssh_sensitive_resource.kubeconfig[0].result).users[0].user.client-key-data), null)
sensitive = true
description = "Cluster Client Key"
}

output "client_crt" {
value = try(base64decode(yamldecode(ssh_sensitive_resource.kubeconfig[0].result).users[0].user.client-certificate-data), null)
sensitive = true
description = "Cluster Client Certificate"
}

output "ca_crt" {
value = try(base64decode(yamldecode(ssh_sensitive_resource.kubeconfig[0].result).clusters[0].cluster.certificate-authority-data), null)
sensitive = true
description = "Cluster CA Certificate"
}

0 comments on commit f116950

Please sign in to comment.