Skip to content

Commit a224334

Browse files
authored
feat: Add support for pod identity association on EKS addons (#3203)
1 parent d2e6262 commit a224334

File tree

23 files changed

+97
-39
lines changed

23 files changed

+97
-39
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ module "eks" {
7070
access_entries = {
7171
# One access entry with a policy associated
7272
example = {
73-
kubernetes_groups = []
7473
principal_arn = "arn:aws:iam::123456789012:role/something"
7574
7675
policy_associations = {
@@ -175,15 +174,15 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
175174
| Name | Version |
176175
|------|---------|
177176
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
178-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.74 |
177+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.75 |
179178
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9 |
180179
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 3.0 |
181180

182181
## Providers
183182

184183
| Name | Version |
185184
|------|---------|
186-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74 |
185+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.75 |
187186
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.9 |
188187
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 3.0 |
189188

examples/eks-managed-node-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.74"
7+
version = ">= 5.75"
88
}
99
}
1010
}

examples/karpenter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ Note that this example may create resources which cost money. Run `terraform des
8989
| Name | Version |
9090
|------|---------|
9191
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
92-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.74 |
92+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.75 |
9393
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.7 |
9494
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 2.0 |
9595

9696
## Providers
9797

9898
| Name | Version |
9999
|------|---------|
100-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74 |
101-
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 5.74 |
100+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.75 |
101+
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 5.75 |
102102
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.7 |
103103
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | >= 2.0 |
104104

examples/karpenter/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.74"
7+
version = ">= 5.75"
88
}
99
helm = {
1010
source = "hashicorp/helm"

examples/self-managed-node-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.74"
7+
version = ">= 5.75"
88
}
99
}
1010
}

main.tf

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,18 @@ resource "aws_eks_addon" "this" {
496496
cluster_name = aws_eks_cluster.this[0].name
497497
addon_name = try(each.value.name, each.key)
498498

499-
addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version)
500-
configuration_values = try(each.value.configuration_values, null)
499+
addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version)
500+
configuration_values = try(each.value.configuration_values, null)
501+
502+
dynamic "pod_identity_association" {
503+
for_each = try(each.value.pod_identity_association, [])
504+
505+
content {
506+
role_arn = pod_identity_association.value.role_arn
507+
service_account = pod_identity_association.value.service_account
508+
}
509+
}
510+
501511
preserve = try(each.value.preserve, true)
502512
resolve_conflicts_on_create = try(each.value.resolve_conflicts_on_create, "OVERWRITE")
503513
resolve_conflicts_on_update = try(each.value.resolve_conflicts_on_update, "OVERWRITE")
@@ -525,8 +535,18 @@ resource "aws_eks_addon" "before_compute" {
525535
cluster_name = aws_eks_cluster.this[0].name
526536
addon_name = try(each.value.name, each.key)
527537

528-
addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version)
529-
configuration_values = try(each.value.configuration_values, null)
538+
addon_version = coalesce(try(each.value.addon_version, null), data.aws_eks_addon_version.this[each.key].version)
539+
configuration_values = try(each.value.configuration_values, null)
540+
541+
dynamic "pod_identity_association" {
542+
for_each = try(each.value.pod_identity_association, [])
543+
544+
content {
545+
role_arn = pod_identity_association.value.role_arn
546+
service_account = pod_identity_association.value.service_account
547+
}
548+
}
549+
530550
preserve = try(each.value.preserve, true)
531551
resolve_conflicts_on_create = try(each.value.resolve_conflicts_on_create, "OVERWRITE")
532552
resolve_conflicts_on_update = try(each.value.resolve_conflicts_on_update, "OVERWRITE")

modules/eks-managed-node-group/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ module "eks_managed_node_group" {
6464
| Name | Version |
6565
|------|---------|
6666
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
67-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.74 |
67+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.75 |
6868

6969
## Providers
7070

7171
| Name | Version |
7272
|------|---------|
73-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74 |
73+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.75 |
7474

7575
## Modules
7676

modules/eks-managed-node-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.74"
7+
version = ">= 5.75"
88
}
99
}
1010
}

modules/fargate-profile/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ module "fargate_profile" {
2929
| Name | Version |
3030
|------|---------|
3131
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
32-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.74 |
32+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.75 |
3333

3434
## Providers
3535

3636
| Name | Version |
3737
|------|---------|
38-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74 |
38+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.75 |
3939

4040
## Modules
4141

modules/fargate-profile/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.74"
7+
version = ">= 5.75"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)