Skip to content

Commit

Permalink
add profile as a var
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 19, 2024
1 parent c3985ea commit d64e45b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d64e45b

Please sign in to comment.