Skip to content

Commit 776009d

Browse files
author
Kaji
authored
fix: Wrong rolearn in aws_auth_configmap_yaml (#1820)
1 parent b38124b commit 776009d

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ locals {
309309
groups:
310310
- system:bootstrappers
311311
- system:nodes
312-
- rolearn: ${module.fargate_profile.fargate_profile_arn}
312+
- rolearn: ${module.fargate_profile.fargate_profile_pod_execution_role_arn}
313313
username: system:node:{{SessionName}}
314314
groups:
315315
- system:bootstrappers

modules/fargate-profile/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ No modules.
8181
|------|-------------|
8282
| <a name="output_fargate_profile_arn"></a> [fargate\_profile\_arn](#output\_fargate\_profile\_arn) | Amazon Resource Name (ARN) of the EKS Fargate Profile |
8383
| <a name="output_fargate_profile_id"></a> [fargate\_profile\_id](#output\_fargate\_profile\_id) | EKS Cluster name and EKS Fargate Profile name separated by a colon (`:`) |
84+
| <a name="output_fargate_profile_pod_execution_role_arn"></a> [fargate\_profile\_pod\_execution\_role\_arn](#output\_fargate\_profile\_pod\_execution\_role\_arn) | Amazon Resource Name (ARN) of the EKS Fargate Profile Pod execution role ARN |
8485
| <a name="output_fargate_profile_status"></a> [fargate\_profile\_status](#output\_fargate\_profile\_status) | Status of the EKS Fargate Profile |
8586
| <a name="output_iam_role_arn"></a> [iam\_role\_arn](#output\_iam\_role\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |
8687
| <a name="output_iam_role_name"></a> [iam\_role\_name](#output\_iam\_role\_name) | The name of the IAM role |

modules/fargate-profile/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ output "fargate_profile_status" {
3535
description = "Status of the EKS Fargate Profile"
3636
value = try(aws_eks_fargate_profile.this[0].status, "")
3737
}
38+
39+
output "fargate_profile_pod_execution_role_arn" {
40+
description = "Amazon Resource Name (ARN) of the EKS Fargate Profile Pod execution role ARN"
41+
value = try(aws_eks_fargate_profile.this[0].pod_execution_role_arn, "")
42+
}

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ output "aws_auth_configmap_yaml" {
165165
description = "Formatted yaml output for base aws-auth configmap containing roles used in cluster node groups/fargate profiles"
166166
value = templatefile("${path.module}/templates/aws_auth_cm.tpl",
167167
{
168-
eks_managed_role_arns = [for group in module.eks_managed_node_group : group.iam_role_arn]
169-
self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"]
170-
win32_self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"]
171-
fargate_profile_arns = [for group in module.fargate_profile : group.fargate_profile_arn]
168+
eks_managed_role_arns = [for group in module.eks_managed_node_group : group.iam_role_arn]
169+
self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"]
170+
win32_self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"]
171+
fargate_profile_pod_execution_role_arns = [for group in module.fargate_profile : group.fargate_profile_pod_execution_role_arn]
172172
}
173173
)
174174
}

templates/aws_auth_cm.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ data:
2727
- system:bootstrappers
2828
- system:nodes
2929
%{ endfor ~}
30-
%{ for role in fargate_profile_arns ~}
30+
%{ for role in fargate_profile_pod_execution_role_arns ~}
3131
- rolearn: ${role}
3232
username: system:node:{{SessionName}}
3333
groups:

0 commit comments

Comments
 (0)