Skip to content

Commit

Permalink
Enable EKS access entries authentication option
Browse files Browse the repository at this point in the history
  • Loading branch information
OlamideOl1 committed Dec 16, 2024
1 parent 1a77025 commit c725251
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
22 changes: 12 additions & 10 deletions aws/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ module "network" {
module "eks_cluster" {
source = "./modules/eks-cluster"

enabled_cluster_log_types = var.enabled_cluster_log_types
endpoint_private_access = var.endpoint_private_access
endpoint_public_access = var.endpoint_public_access
k8s_version = var.k8s_version
log_retention_in_days = var.log_retention_in_days
name = module.cluster_name.full
private_subnet_ids = module.network.private_subnet_ids
public_subnet_ids = module.network.public_subnet_ids
tags = var.tags
vpc = module.network.vpc
auth_mode = var.auth_mode
bootstrap_cluster_creator_admin_permission = var.bootstrap_cluster_creator_admin_permission
enabled_cluster_log_types = var.enabled_cluster_log_types
endpoint_private_access = var.endpoint_private_access
endpoint_public_access = var.endpoint_public_access
k8s_version = var.k8s_version
log_retention_in_days = var.log_retention_in_days
name = module.cluster_name.full
private_subnet_ids = module.network.private_subnet_ids
public_subnet_ids = module.network.public_subnet_ids
tags = var.tags
vpc = module.network.vpc

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 = var.bootstrap_cluster_creator_admin_permission
}

vpc_config {
security_group_ids = [aws_security_group.control_plane.id]
subnet_ids = concat(var.private_subnet_ids, var.public_subnet_ids)
Expand Down
11 changes: 11 additions & 0 deletions aws/cluster/modules/eks-cluster/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
variable "auth_mode" {
type = string
description = "Authentiation mode associated with the cluster Access config"
default = "API_AND_CONFIG_MAP"
}
variable "bootstrap_cluster_creator_admin_permission" {
type = bool
description = "Bootstrap access config values to the cluster"
default = false
}

variable "enabled_cluster_log_types" {
type = list(string)
default = ["api", "audit"]
Expand Down

0 comments on commit c725251

Please sign in to comment.