Skip to content

Instantly share code, notes, and snippets.

@NassK
Last active February 27, 2021 13:49
Show Gist options
  • Save NassK/370dbabef61e05345fd088013a9d1fa3 to your computer and use it in GitHub Desktop.
Save NassK/370dbabef61e05345fd088013a9d1fa3 to your computer and use it in GitHub Desktop.
step_4
# Step 4: Configuring the Kubectl CLI
resource "null_resource" "generate_kubeconfig" { # Generate a kubeconfig (needs aws cli >=1.62 and kubectl)
provisioner "local-exec" {
command = "aws eks update-kubeconfig --name ${var.cluster_name}"
}
depends_on = [aws_eks_cluster.cluster]
}
variable "region" {
description = "The AWS region"
default = "eu-west-1"
}
variable "cluster_name" {
description = "The name of the Amazon EKS cluster."
default = "my-eks-cluster"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment