Skip to content

Commit

Permalink
fix: Wrong rolearn in aws_auth_configmap_yaml (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorlondo448 committed Feb 1, 2022
1 parent b38124b commit 776009d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ locals {
groups:
- system:bootstrappers
- system:nodes
- rolearn: ${module.fargate_profile.fargate_profile_arn}
- rolearn: ${module.fargate_profile.fargate_profile_pod_execution_role_arn}
username: system:node:{{SessionName}}
groups:
- system:bootstrappers
Expand Down
1 change: 1 addition & 0 deletions modules/fargate-profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ No modules.
|------|-------------|
| <a name="output_fargate_profile_arn"></a> [fargate\_profile\_arn](#output\_fargate\_profile\_arn) | Amazon Resource Name (ARN) of the EKS Fargate Profile |
| <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 (`:`) |
| <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 |
| <a name="output_fargate_profile_status"></a> [fargate\_profile\_status](#output\_fargate\_profile\_status) | Status of the EKS Fargate Profile |
| <a name="output_iam_role_arn"></a> [iam\_role\_arn](#output\_iam\_role\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |
| <a name="output_iam_role_name"></a> [iam\_role\_name](#output\_iam\_role\_name) | The name of the IAM role |
Expand Down
5 changes: 5 additions & 0 deletions modules/fargate-profile/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ output "fargate_profile_status" {
description = "Status of the EKS Fargate Profile"
value = try(aws_eks_fargate_profile.this[0].status, "")
}

output "fargate_profile_pod_execution_role_arn" {
description = "Amazon Resource Name (ARN) of the EKS Fargate Profile Pod execution role ARN"
value = try(aws_eks_fargate_profile.this[0].pod_execution_role_arn, "")
}
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ output "aws_auth_configmap_yaml" {
description = "Formatted yaml output for base aws-auth configmap containing roles used in cluster node groups/fargate profiles"
value = templatefile("${path.module}/templates/aws_auth_cm.tpl",
{
eks_managed_role_arns = [for group in module.eks_managed_node_group : group.iam_role_arn]
self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"]
win32_self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"]
fargate_profile_arns = [for group in module.fargate_profile : group.fargate_profile_arn]
eks_managed_role_arns = [for group in module.eks_managed_node_group : group.iam_role_arn]
self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"]
win32_self_managed_role_arns = [for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"]
fargate_profile_pod_execution_role_arns = [for group in module.fargate_profile : group.fargate_profile_pod_execution_role_arn]
}
)
}
2 changes: 1 addition & 1 deletion templates/aws_auth_cm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data:
- system:bootstrappers
- system:nodes
%{ endfor ~}
%{ for role in fargate_profile_arns ~}
%{ for role in fargate_profile_pod_execution_role_arns ~}
- rolearn: ${role}
username: system:node:{{SessionName}}
groups:
Expand Down

0 comments on commit 776009d

Please sign in to comment.