diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1acb056..a6b04fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,7 @@ We use GitHub issues to track public bugs. Report a bug by opening a new issue h ## Run make test to test your infrastructure after running Terraform ```shell +$ make lint # runs the linter $ make test # runs terratest tests against your currently connected AWS account. ``` diff --git a/main.tf b/main.tf index 11900db..f39c65c 100644 --- a/main.tf +++ b/main.tf @@ -96,6 +96,7 @@ module "cluster" { tls_cert = var.tls_cert tls_key = var.tls_key local-exec-interpreter = var.local-exec-interpreter + profile = var.profile } // ---------------------------------------------------------------------------- diff --git a/modules/cluster/main.tf b/modules/cluster/main.tf index e6c6f17..54777e9 100644 --- a/modules/cluster/main.tf +++ b/modules/cluster/main.tf @@ -148,7 +148,7 @@ resource "null_resource" "kubeconfig" { module.eks ] provisioner "local-exec" { - command = "aws eks update-kubeconfig --name ${var.cluster_name} --region=${var.region}" + command = "aws eks update-kubeconfig --name ${var.cluster_name} --region=${var.region} ${var.profile == null ? "" : format("--profile=%s", var.profile)}" interpreter = var.local-exec-interpreter } } diff --git a/modules/cluster/variables.tf b/modules/cluster/variables.tf index 1909ab0..27ecb39 100644 --- a/modules/cluster/variables.tf +++ b/modules/cluster/variables.tf @@ -13,6 +13,12 @@ variable "cluster_version" { type = string } +variable "profile" { + description = "The AWS Profile used to provision the EKS Cluster" + type = string + default = null +} + # Worker Nodes variable "desired_node_count" { type = number diff --git a/variables.tf b/variables.tf index 17e4326..4aef171 100644 --- a/variables.tf +++ b/variables.tf @@ -13,6 +13,12 @@ variable "cluster_name" { default = "" } +variable "profile" { + description = "The AWS Profile used to provision the EKS Cluster" + type = string + default = null +} + variable "cluster_version" { description = "Kubernetes version to use for the EKS cluster." type = string