Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #288: not able to use AWS Profiles #310

Merged
merged 8 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```

Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

// ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
6 changes: 6 additions & 0 deletions modules/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down