Skip to content

Commit

Permalink
Added aws profile variable when trying to install cast.ai using the e…
Browse files Browse the repository at this point in the history
…ks_cluster_existing example (#269)

Signed-off-by: Aymen Ben Tanfous <[email protected]>
Co-authored-by: Aymen Ben Tanfous <[email protected]>
  • Loading branch information
Aym3nTN and Aymen Ben Tanfous authored Jan 16, 2024
1 parent 44ec057 commit 9746bc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/eks/eks_cluster_existing/castai.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provider "helm" {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
# This requires the awscli to be installed locally where Terraform is executed.
args = ["eks", "get-token", "--cluster-name", var.cluster_name, "--region", var.cluster_region]
args = ["eks", "get-token", "--cluster-name", var.cluster_name, "--region", var.cluster_region, "--profile", var.profile]
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions examples/eks/eks_cluster_existing/providers.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Following providers required by EKS and VPC modules.
provider "aws" {
region = var.cluster_region
region = var.cluster_region
profile = var.profile
}


provider "kubernetes" {
host = data.aws_eks_cluster.existing_cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.existing_cluster.certificate_authority.0.data)
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
# This requires the awscli to be installed locally where Terraform is executed
args = ["eks", "get-token", "--cluster-name", var.cluster_name, "--region", var.cluster_region]
args = ["eks", "get-token", "--cluster-name", var.cluster_name, "--region", var.cluster_region, "--profile", var.profile]
}
}
8 changes: 7 additions & 1 deletion examples/eks/eks_cluster_existing/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# EKS module variables.
variable "profile" {
type = string
description = "Profile used with AWS CLI"
default = "default"
}

variable "cluster_name" {
type = string
description = "EKS cluster name in AWS account."
Expand Down Expand Up @@ -58,4 +64,4 @@ variable "node_security_group_id" {
variable "subnets" {
type = list(string)
description = "Subnet IDs used by CAST AI to provision nodes"
}
}

0 comments on commit 9746bc5

Please sign in to comment.