Skip to content

Commit 23f29cc

Browse files
authored
[eks/cluster] Fix AWS SSO support (#1072)
1 parent 4211160 commit 23f29cc

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

modules/eks/cluster/CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
## Release 1.466.1
1+
## Release 1.468.0
2+
3+
PR [#1072](https://github.com/cloudposse/terraform-aws-components/pull/1072)
4+
5+
Bugfix:
6+
7+
- Correctly map AWS SSO Permission Sets referenced by `aws_sso_permission_sets_rbac` to IAM Role ARNs.
8+
- Broken in Release 1.431.1: Update to use AWS Auth API
9+
10+
## Release 1.467.0
211

312
PR [#1071](https://github.com/cloudposse/terraform-aws-components/pull/1071)
413

@@ -34,7 +43,9 @@ script.
3443
This support should be considered an `alpha` version, as it may change when support for Amazon Linux 2023 is added, and
3544
does not work with Bottlerocket.
3645

37-
## Breaking Changes: Components PR [#1033](https://github.com/cloudposse/terraform-aws-components/pull/1033)
46+
## Release 1.431.1: Breaking Changes
47+
48+
Components PR [#1033](https://github.com/cloudposse/terraform-aws-components/pull/1033)
3849

3950
### Major Breaking Changes
4051

modules/eks/cluster/aws-sso.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
locals {
55

66
aws_sso_access_entry_map = {
7-
for role in var.aws_sso_permission_sets_rbac : data.aws_iam_roles.sso_roles[role.aws_sso_permission_set] => {
7+
for role in var.aws_sso_permission_sets_rbac : tolist(data.aws_iam_roles.sso_roles[role.aws_sso_permission_set].arns)[0] => {
88
kubernetes_groups = role.groups
99
}
1010
}
@@ -14,4 +14,13 @@ data "aws_iam_roles" "sso_roles" {
1414
for_each = toset(var.aws_sso_permission_sets_rbac[*].aws_sso_permission_set)
1515
name_regex = format("AWSReservedSSO_%s_.*", each.value)
1616
path_prefix = "/aws-reserved/sso.amazonaws.com/"
17+
18+
lifecycle {
19+
postcondition {
20+
condition = length(self.arns) == 1
21+
error_message = length(self.arns) == 0 ? "Could not find Role ARN for the AWS SSO permission set: ${each.value}" : (
22+
"Found more than one (${length(self.arns)}) Role ARN for the AWS SSO permission set: ${each.value}"
23+
)
24+
}
25+
}
1726
}

0 commit comments

Comments
 (0)