diff --git a/main.tf b/main.tf index 04fd1e5..074159b 100644 --- a/main.tf +++ b/main.tf @@ -173,7 +173,7 @@ resource "null_resource" "kube_config_create" { depends_on = [module.cluster.cluster_name] provisioner "local-exec" { interpreter = ["/bin/bash", "-c"] - command = "aws eks --region ${data.aws_region.current.name} update-kubeconfig --name ${module.cluster.cluster_name} --profile=${module.cluster.profile} && export KUBE_CONFIG_PATH=~/.kube/config && export KUBERNETES_MASTER=~/.kube/config" + command = "aws eks --region ${data.aws_region.current.name} update-kubeconfig --name ${module.cluster.cluster_name} --profile=${var.profile} && export KUBE_CONFIG_PATH=~/.kube/config && export KUBERNETES_MASTER=~/.kube/config" } } diff --git a/variables.tf b/variables.tf index 8cd358a..eb16b7f 100644 --- a/variables.tf +++ b/variables.tf @@ -101,6 +101,12 @@ variable "tags" { default = {} } +variable "profile" { + description = "AWS config profile" + type = string + default = "" +} + variable "aws_environment" { description = "AWS Environment (govcloud | east-west)" type = string