Skip to content

Commit

Permalink
Verify cluster access.
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Dec 13, 2024
1 parent b6416ae commit 5714a7e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions terraform/eks/e2e/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module "basic_components" {

locals {
cluster_name = var.cluster_name != "" ? var.cluster_name : "cwagent-monitoring-config-e2e-eks"
aws_eks = "aws eks"
}

data "aws_eks_cluster_auth" "this" {
Expand Down Expand Up @@ -53,6 +54,8 @@ resource "kubernetes_config_map" "aws_auth" {
])
}

force = true

depends_on = [aws_eks_cluster.this]
}

Expand Down Expand Up @@ -120,6 +123,20 @@ resource "aws_iam_role_policy_attachment" "node_CloudWatchAgentServerPolicy" {
role = aws_iam_role.node_role.name
}

resource "null_resource" "kubectl" {
depends_on = [
aws_eks_cluster.this,
aws_eks_node_group.this,
]
provisioner "local-exec" {
command = <<-EOT
${local.aws_eks} update-kubeconfig --name ${aws_eks_cluster.this.name}
${local.aws_eks} list-clusters --output text
${local.aws_eks} describe-cluster --name ${aws_eks_cluster.this.name} --output text
EOT
}
}

resource "null_resource" "helm_charts" {
provisioner "local-exec" {
command = <<-EOT
Expand Down

0 comments on commit 5714a7e

Please sign in to comment.