Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiyerra committed May 10, 2024
2 parents b9d38bb + 2b3baa7 commit 6166e9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "aws_eks_cluster" "cluster" {
}

access_config {
authentication_mode = "API_AND_CONFIG_MAP"
authentication_mode = var.cluster_authentication_mode
}

dynamic "encryption_config" {
Expand Down
2 changes: 2 additions & 0 deletions kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ data "aws_eks_cluster_auth" "cluster" {
}

resource "kubernetes_config_map" "aws_auth" {
count = var.cluster_authentication_mode == "API_AND_CONFIG_MAP" ? 1 : 0

metadata {
name = "aws-auth"
namespace = "kube-system"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ variable "cluster_version" {
description = "Desired Kubernetes master version"
}

variable "cluster_authentication_mode" {
default = "API"
description = "Desired Kubernetes authentication. API or API_AND_CONFIG_MAP"

}

variable "cloudwatch_retention_in_days" {
default = 30
description = "How long to keep CloudWatch logs in days"
Expand Down

0 comments on commit 6166e9a

Please sign in to comment.