Skip to content

Commit

Permalink
Adding access config support to cluster module
Browse files Browse the repository at this point in the history
  • Loading branch information
William authored and William committed Nov 18, 2024
1 parent 22f3564 commit 067dbdd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions aws/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module "eks_cluster" {
public_subnet_ids = module.network.public_subnet_ids
tags = var.tags
vpc = module.network.vpc
auth_mode = var.auth_mode

depends_on = [module.node_role]
}
Expand Down
5 changes: 5 additions & 0 deletions aws/cluster/modules/eks-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ resource "aws_eks_cluster" "this" {
tags = var.tags
version = var.k8s_version

access_config {
authentication_mode = var.auth_mode
bootstrap_cluster_creator_admin_permissions = true
}

vpc_config {
security_group_ids = [aws_security_group.control_plane.id]
subnet_ids = concat(var.private_subnet_ids, var.public_subnet_ids)
Expand Down
6 changes: 6 additions & 0 deletions aws/cluster/modules/eks-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ variable "vpc" {
type = object({ id = string })
description = "VPC in which this cluster should run"
}

variable "auth_mode" {
type = string
description = "Authentiation mode associated with the cluster Access config"
default = "API_AND_CONFIG_MAP"
}
6 changes: 6 additions & 0 deletions aws/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ variable "tags" {
description = "Tags to be applied to all created resources"
default = {}
}

variable "auth_mode" {
type = string
description = "Authentiation mode associated with the cluster Access config"
default = "API_AND_CONFIG_MAP"
}

0 comments on commit 067dbdd

Please sign in to comment.