Skip to content
Open
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
31 changes: 14 additions & 17 deletions infrastructure/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data "aws_caller_identity" "current" {}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.21.0"
version = "6.5.0"

name = "${var.cluster_name}-vpc"

Expand All @@ -29,19 +29,19 @@ module "vpc" {

module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "20.37.2"
version = "21.8.0"

cluster_name = var.cluster_name
cluster_version = var.cluster_version
name = var.cluster_name
kubernetes_version = var.cluster_version

vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
cluster_endpoint_public_access = true
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
endpoint_public_access = true

# Enable the CloudWatch log group and detailed EKS logs (API, audit, etc.) only when `local.debug` is true.
# This helps with troubleshooting and deeper visibility while avoiding unnecessary overhead otherwise.
create_cloudwatch_log_group = local.debug
cluster_enabled_log_types = local.debug ? [
enabled_log_types = local.debug ? [
"api",
"audit",
"authenticator",
Expand All @@ -52,7 +52,7 @@ module "eks" {
authentication_mode = "API_AND_CONFIG_MAP"
enable_cluster_creator_admin_permissions = true

# On local environments, the user credentials are already configured automatically, so we dont need to set them again.
# On local environments, the user credentials are already configured automatically, so we don't need to set them again.
# This configuration is only necessary on CI to grant access to the cluster from our CI role/account.
access_entries = local.ci ? {
poweruser = {
Expand All @@ -70,14 +70,11 @@ module "eks" {
}
} : {}

eks_managed_node_group_defaults = {
ami_type = "AL2_ARM_64"
}

eks_managed_node_groups = {
default = {
name = "default"

ami_type = "AL2_ARM_64"
instance_types = [var.nodes_type]

min_size = var.nodes_number
Expand All @@ -97,7 +94,7 @@ module "eks" {
}
}

cluster_addons = {
addons = {
aws-ebs-csi-driver = {
most_recent = true
service_account_role_arn = module.ebs_csi_irsa_role.iam_role_arn
Expand All @@ -123,7 +120,7 @@ module "eks" {

module "ecr" {
source = "terraform-aws-modules/ecr/aws"
version = "2.4.0"
version = "3.1.0"
for_each = toset(["kuma-dp", "fake-service"])

repository_name = each.key
Expand All @@ -150,8 +147,8 @@ module "ecr" {
}

module "ebs_csi_irsa_role" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
version = "5.60.0"
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts"
version = "6.2.3"

role_name = "ebs-csi-${var.cluster_name}"
attach_ebs_csi_policy = true
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/eks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "region" {

output "registry" {
description = "ECR registry for storing and retrieving container images"
value = format("%s.dkr.ecr.%s.amazonaws.com", values(module.ecr)[0].repository_registry_id, var.region)
value = format("%s.dkr.ecr.%s.amazonaws.com", values(module.ecr)[0].repository_registry_id, var.region)
}
2 changes: 1 addition & 1 deletion infrastructure/eks/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.100.0"
version = "6.20.0"
}

helm = {
Expand Down
Loading