From b3f60599b00edc41d40c076a84d36244919bdb43 Mon Sep 17 00:00:00 2001 From: Niall Thomson Date: Thu, 12 Dec 2024 12:36:40 -0700 Subject: [PATCH] feat: Upgrade EKS Terraform to 1.30 --- deploy/terraform/eks/default/data.tf | 2 -- deploy/terraform/eks/default/main.tf | 2 +- deploy/terraform/eks/default/opentelemetry.tf | 2 +- deploy/terraform/eks/default/variables.tf | 5 +++-- deploy/terraform/eks/minimal/data.tf | 2 -- deploy/terraform/eks/minimal/main.tf | 2 +- deploy/terraform/eks/minimal/providers.tf | 2 +- deploy/terraform/eks/minimal/variables.tf | 5 +++-- deploy/terraform/lib/eks/adot.tf | 1 - deploy/terraform/lib/eks/data.tf | 6 ------ deploy/terraform/lib/eks/outputs.tf | 3 ++- deploy/terraform/lib/eks/variables.tf | 6 ++++-- deploy/terraform/lib/eks/versions.tf | 6 +++--- 13 files changed, 19 insertions(+), 25 deletions(-) diff --git a/deploy/terraform/eks/default/data.tf b/deploy/terraform/eks/default/data.tf index e615b0b5a..b8cb8bb98 100644 --- a/deploy/terraform/eks/default/data.tf +++ b/deploy/terraform/eks/default/data.tf @@ -1,5 +1,3 @@ -data "aws_region" "current" {} - data "aws_eks_cluster_auth" "this" { name = module.retail_app_eks.eks_cluster_id diff --git a/deploy/terraform/eks/default/main.tf b/deploy/terraform/eks/default/main.tf index e13b8caaf..bb3a3c9c5 100644 --- a/deploy/terraform/eks/default/main.tf +++ b/deploy/terraform/eks/default/main.tf @@ -52,7 +52,7 @@ module "retail_app_eks" { } environment_name = var.environment_name - cluster_version = "1.28" + cluster_version = "1.30" vpc_id = module.vpc.inner.vpc_id vpc_cidr = module.vpc.inner.vpc_cidr_block subnet_ids = module.vpc.inner.private_subnets diff --git a/deploy/terraform/eks/default/opentelemetry.tf b/deploy/terraform/eks/default/opentelemetry.tf index 0360b916b..7fd065507 100644 --- a/deploy/terraform/eks/default/opentelemetry.tf +++ b/deploy/terraform/eks/default/opentelemetry.tf @@ -10,7 +10,7 @@ resource "kubectl_manifest" "otel_instrumentation" { "kind" = "Instrumentation" "metadata" = { "name" = "default-instrumentation" - "namespace" = "${module.retail_app_eks.adot_namespace}" + "namespace" = module.retail_app_eks.adot_namespace } "spec" = { "env" = [ diff --git a/deploy/terraform/eks/default/variables.tf b/deploy/terraform/eks/default/variables.tf index 33f4746af..e11cc8bfb 100644 --- a/deploy/terraform/eks/default/variables.tf +++ b/deploy/terraform/eks/default/variables.tf @@ -1,6 +1,7 @@ variable "environment_name" { - type = string - default = "retail-store" + description = "Name of the environment" + type = string + default = "retail-store" } variable "istio_enabled" { diff --git a/deploy/terraform/eks/minimal/data.tf b/deploy/terraform/eks/minimal/data.tf index db220ccd2..7081b4cc1 100644 --- a/deploy/terraform/eks/minimal/data.tf +++ b/deploy/terraform/eks/minimal/data.tf @@ -1,5 +1,3 @@ -data "aws_region" "current" {} - data "aws_eks_cluster_auth" "this" { name = module.retail_app_eks.eks_cluster_id diff --git a/deploy/terraform/eks/minimal/main.tf b/deploy/terraform/eks/minimal/main.tf index 452cc16b4..b518d7c0d 100644 --- a/deploy/terraform/eks/minimal/main.tf +++ b/deploy/terraform/eks/minimal/main.tf @@ -33,7 +33,7 @@ module "retail_app_eks" { } environment_name = var.environment_name - cluster_version = "1.28" + cluster_version = "1.30" vpc_id = module.vpc.inner.vpc_id vpc_cidr = module.vpc.inner.vpc_cidr_block subnet_ids = module.vpc.inner.private_subnets diff --git a/deploy/terraform/eks/minimal/providers.tf b/deploy/terraform/eks/minimal/providers.tf index 3aacb16aa..38ae7b826 100644 --- a/deploy/terraform/eks/minimal/providers.tf +++ b/deploy/terraform/eks/minimal/providers.tf @@ -1,7 +1,7 @@ terraform { required_providers { aws = { - source = "hashicorp/aws" + source = "hashicorp/aws" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/deploy/terraform/eks/minimal/variables.tf b/deploy/terraform/eks/minimal/variables.tf index d032aa983..66d73aba7 100644 --- a/deploy/terraform/eks/minimal/variables.tf +++ b/deploy/terraform/eks/minimal/variables.tf @@ -1,6 +1,7 @@ variable "environment_name" { - type = string - default = "retail-store" + description = "Name of the environment" + type = string + default = "retail-store" } variable "istio_enabled" { diff --git a/deploy/terraform/lib/eks/adot.tf b/deploy/terraform/lib/eks/adot.tf index 037b985a5..209f1a7de 100644 --- a/deploy/terraform/lib/eks/adot.tf +++ b/deploy/terraform/lib/eks/adot.tf @@ -12,7 +12,6 @@ resource "kubernetes_namespace_v1" "adot" { resource "aws_eks_addon" "adot" { cluster_name = module.eks_cluster.cluster_name addon_name = "adot" - addon_version = "v0.94.1-eksbuild.1" resolve_conflicts_on_create = "OVERWRITE" resolve_conflicts_on_update = "OVERWRITE" preserve = false diff --git a/deploy/terraform/lib/eks/data.tf b/deploy/terraform/lib/eks/data.tf index cea078dd0..ff56e9e48 100644 --- a/deploy/terraform/lib/eks/data.tf +++ b/deploy/terraform/lib/eks/data.tf @@ -1,9 +1,3 @@ -data "aws_eks_cluster_auth" "this" { - name = module.eks_cluster.cluster_name -} - -data "aws_availability_zones" "available" {} - data "aws_region" "current" {} data "aws_partition" "current" {} diff --git a/deploy/terraform/lib/eks/outputs.tf b/deploy/terraform/lib/eks/outputs.tf index 6cef51a43..61873f866 100644 --- a/deploy/terraform/lib/eks/outputs.tf +++ b/deploy/terraform/lib/eks/outputs.tf @@ -39,5 +39,6 @@ output "configure_kubectl" { } output "adot_namespace" { - value = kubernetes_namespace_v1.adot.metadata[0].name + description = "Namespace where ADOT is deployed" + value = kubernetes_namespace_v1.adot.metadata[0].name } diff --git a/deploy/terraform/lib/eks/variables.tf b/deploy/terraform/lib/eks/variables.tf index 5ed35bfa4..3bca6357b 100644 --- a/deploy/terraform/lib/eks/variables.tf +++ b/deploy/terraform/lib/eks/variables.tf @@ -1,16 +1,18 @@ variable "environment_name" { - type = string + description = "Name of the environment" + type = string } variable "cluster_version" { description = "EKS cluster version." type = string - default = "1.29" + default = "1.30" } variable "tags" { description = "List of tags to be associated with resources." default = {} + type = map(string) } variable "vpc_id" { diff --git a/deploy/terraform/lib/eks/versions.tf b/deploy/terraform/lib/eks/versions.tf index 48b5770c3..c42a96aa9 100644 --- a/deploy/terraform/lib/eks/versions.tf +++ b/deploy/terraform/lib/eks/versions.tf @@ -7,9 +7,9 @@ terraform { version = ">= 4.48" } kubernetes = { - source = "hashicorp/kubernetes" - version = ">= 2.10" - configuration_aliases = [ kubernetes.cluster, kubernetes.addons ] + source = "hashicorp/kubernetes" + version = ">= 2.10" + configuration_aliases = [kubernetes.cluster, kubernetes.addons] } helm = { source = "hashicorp/helm"