From b52f6495f59ee824cdc95206514f5cff62a9cb75 Mon Sep 17 00:00:00 2001 From: ermisw Date: Tue, 3 Oct 2023 21:41:35 +0200 Subject: [PATCH] changed to token auth data source --- terraform.tf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/terraform.tf b/terraform.tf index e32c3e4..103d254 100644 --- a/terraform.tf +++ b/terraform.tf @@ -5,6 +5,10 @@ data "aws_eks_cluster" "xOps" { name = "xOps" } +data "aws_eks_cluster_auth" "example" { + name = "xOps" +} + terraform { backend "s3" { @@ -40,13 +44,9 @@ provider "aws" { provider "helm" { - # kubernetes { - # host = data.aws_eks_cluster.xOps.endpoint - # cluster_ca_certificate = base64decode(data.aws_eks_cluster.xOps.certificate_authority[0].data) - # exec { - # api_version = "client.authentication.k8s.io/v1beta1" - # args = ["eks", "get-token", "--cluster-name", data.aws_eks_cluster.xOps.name] - # command = "aws" - # } - # } + kubernetes { + host = data.aws_eks_cluster.xOps.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.xOps.certificate_authority[0].data) + token = data.aws_eks_cluster_auth.example.token + } }