From 29af93191986523c80da02abea5641029cb1ac2a Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:13:22 -0600 Subject: [PATCH 1/6] feat: add pod_identity_association --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index ed54916..97da657 100644 --- a/main.tf +++ b/main.tf @@ -167,6 +167,7 @@ resource "aws_eks_addon" "cluster" { resolve_conflicts_on_create = lookup(each.value, "resolve_conflicts_on_create", try(replace(each.value.resolve_conflicts, "PRESERVE", "NONE"), null)) resolve_conflicts_on_update = lookup(each.value, "resolve_conflicts_on_update", lookup(each.value, "resolve_conflicts", null)) service_account_role_arn = lookup(each.value, "service_account_role_arn", null) + pod_identity_association = lookup(each.value, "pod_identity_association", null) tags = module.label.tags From ee8d21104e8d9ca4d095eb36ad865ac85ba33b7a Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:16:48 -0600 Subject: [PATCH 2/6] feat: add pod_identity_association --- variables.tf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 6d7f201..77e2ef1 100644 --- a/variables.tf +++ b/variables.tf @@ -1,6 +1,5 @@ # tflint-ignore: terraform_unused_declarations variable "region" { - type = string description = "OBSOLETE (not needed): AWS Region" default = null @@ -175,6 +174,10 @@ variable "addons" { create_timeout = optional(string, null) update_timeout = optional(string, null) delete_timeout = optional(string, null) + pod_identity_association = optional(object({ + role_arn = string + service_account = string + })) })) description = <<-EOT Manages [`aws_eks_addon`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) resources. From dc44e1048234ad867993a49c27af11b424fef078 Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:25:57 -0600 Subject: [PATCH 3/6] feat: allow pod identity config block in eks addons --- main.tf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 97da657..b445969 100644 --- a/main.tf +++ b/main.tf @@ -167,7 +167,17 @@ resource "aws_eks_addon" "cluster" { resolve_conflicts_on_create = lookup(each.value, "resolve_conflicts_on_create", try(replace(each.value.resolve_conflicts, "PRESERVE", "NONE"), null)) resolve_conflicts_on_update = lookup(each.value, "resolve_conflicts_on_update", lookup(each.value, "resolve_conflicts", null)) service_account_role_arn = lookup(each.value, "service_account_role_arn", null) - pod_identity_association = lookup(each.value, "pod_identity_association", null) + + pod_identity_association = lookup(each.value, "pod_identity_association", null) + + dynamic "pod_identity_association" { + for_each = try(lookup(each.value, "pod_identity_association", null), null) != null ? [true] : [] + + content { + role_arn = try(lookup(each.value.pod_identity_association, "role_arn"), null) + service_account = try(lookup(each.value.pod_identity_association, "service_account"), null) + } + } tags = module.label.tags From d510b58335f23ff9af881eca6ddd627c21475f16 Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:28:01 -0600 Subject: [PATCH 4/6] feat: bump to v5.75.0 --- versions.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.tf b/versions.tf index 72033b5..1f04a8a 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.74.0" + version = ">= 5.75.0" } tls = { source = "hashicorp/tls" From 2989569bc0c6868ba7ce7240b1617ccbdbd5c3a6 Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:28:14 -0600 Subject: [PATCH 5/6] feat: bump to v5.75.0 --- examples/complete/versions.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index b3cb434..6610fc5 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.74" + version = ">= 5.75" } kubernetes = { source = "hashicorp/kubernetes" From f422d4d6e57d4a0f62ff97ee3bd3eb8c19cc2697 Mon Sep 17 00:00:00 2001 From: RB <7775707+nitrocode@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:01:40 -0600 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Ihor Urazov --- examples/complete/versions.tf | 2 +- versions.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 6610fc5..78f98a2 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.75" + version = ">= 5.77" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/versions.tf b/versions.tf index 1f04a8a..69d813d 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.75.0" + version = ">= 5.77.0" } tls = { source = "hashicorp/tls"