diff --git a/cluster/provider.tf b/cluster/provider.tf index d554674..485fb0b 100644 --- a/cluster/provider.tf +++ b/cluster/provider.tf @@ -3,6 +3,7 @@ provider "aws" { access_key = var.AWS_ACCESS_KEY_ID secret_key = var.AWS_SECRET_ACCESS_KEY token = var.AWS_SESSION_TOKEN + profile = var.AWS_PROFILE } provider "kubernetes" { @@ -11,7 +12,7 @@ provider "kubernetes" { exec { api_version = "client.authentication.k8s.io/v1beta1" - args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", var.AWS_REGION] + args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", var.AWS_REGION, "--profile", var.AWS_PROFILE] command = "aws" } } @@ -24,7 +25,7 @@ provider "kubectl" { exec { api_version = "client.authentication.k8s.io/v1beta1" - args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", var.AWS_REGION] + args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--region", var.AWS_REGION, "--profile", var.AWS_PROFILE] command = "aws" } } \ No newline at end of file diff --git a/cluster/variables.tf b/cluster/variables.tf index c501d42..ac23027 100644 --- a/cluster/variables.tf +++ b/cluster/variables.tf @@ -7,12 +7,14 @@ variable "AWS_REGION" { variable "AWS_ACCESS_KEY_ID" { type = string description = "AWS access key associated with an IAM account" + default = "" sensitive = true } variable "AWS_SECRET_ACCESS_KEY" { type = string description = "AWS secret key associated with the access key" + default = "" sensitive = true } @@ -23,6 +25,12 @@ variable "AWS_SESSION_TOKEN" { sensitive = true } +variable "AWS_PROFILE" { + type = string + description = "AWS Profile that resources are created in" + default = "default" +} + variable "eks_cluster_name" { type = string description = "EKS cluster name" diff --git a/config/provider.tf b/config/provider.tf index 53dd645..43bf4eb 100644 --- a/config/provider.tf +++ b/config/provider.tf @@ -3,6 +3,7 @@ provider "aws" { access_key = var.AWS_ACCESS_KEY_ID secret_key = var.AWS_SECRET_ACCESS_KEY token = var.AWS_SESSION_TOKEN + profile = var.AWS_PROFILE } provider "kubernetes" { diff --git a/config/variables.tf b/config/variables.tf index 707066c..857764f 100644 --- a/config/variables.tf +++ b/config/variables.tf @@ -23,6 +23,12 @@ variable "AWS_SESSION_TOKEN" { sensitive = true } +variable "AWS_PROFILE" { + type = string + description = "AWS Profile that resources are created in" + default = "default" +} + variable "eks_cluster_name" { type = string description = "EKS cluster name"