diff --git a/main.tf b/main.tf index 9ee6994..af85887 100644 --- a/main.tf +++ b/main.tf @@ -2,6 +2,11 @@ data "aws_eks_cluster_auth" "cluster" { name = var.cluster_name } +data "aws_eks_cluster" "cluster" { + name = var.cluster_name +} + + resource "null_resource" "helm_install" { triggers = { chart_name = var.chart_name @@ -25,8 +30,8 @@ resource "null_resource" "helm_install" { kind: Config clusters: - cluster: - server: ${var.cluster_endpoint} - certificate-authority-data: ${var.cluster_ca_certificate} + server: ${data.aws_eks_cluster.cluster.endpoint} + certificate-authority-data: ${data.aws_eks_cluster.cluster.certificate_authority[0].data} name: kubernetes contexts: - context: diff --git a/variables.tf b/variables.tf index 79744a7..fbe521e 100644 --- a/variables.tf +++ b/variables.tf @@ -34,16 +34,6 @@ variable "repo_url" { description = "URL of the Helm repository" } -variable "cluster_ca_certificate" { - type = string - description = "CA certificate of the cluster" -} - -variable "cluster_endpoint" { - type = string - description = "Endpoint of the cluster" -} - variable "cluster_name" { type = string description = "Name of the cluster"