Skip to content

Commit

Permalink
no kubectl provider needed
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jan 27, 2025
1 parent ed3884d commit 5595a5b
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,6 @@ dependency "eks" {
}
}

generate "kubectl-provider" {
path = "kubectl-provider.tf"
if_exists = "overwrite"
contents = <<-EOF
%{ if dependency.eks.outputs.cluster_name != "a-cluster-name" ~}
data "aws_eks_cluster" "kubectl" {
name = "${dependency.eks.outputs.cluster_name}"
}
provider "kubectl" {
apply_retry_count = 5
host = data.aws_eks_cluster.kubectl.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.kubectl.certificate_authority[0].data)
load_config_file = false
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
args = ["eks", "get-token", "--cluster-name", "${dependency.eks.outputs.cluster_name}", "--region", "${include.root.inputs.aws_region}"]
}
}
%{ endif ~}
EOF
}

inputs = {
cluster_name = dependency.eks.outputs.cluster_name
eks_managed_node_groups_autoscaling_group_names = dependency.eks.outputs.eks_managed_node_groups_autoscaling_group_names
Expand Down

0 comments on commit 5595a5b

Please sign in to comment.