Skip to content

Commit bcdf554

Browse files
wonkoantonbabenkobryantbiggs
authored
fix: Skip retrieving EKS cluster data when not creating the role (#436)
Co-authored-by: Anton Babenko <[email protected]> Co-authored-by: Bryant Biggs <[email protected]>
1 parent 814b8e6 commit bcdf554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/iam-eks-role/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ locals {
88
}
99

1010
data "aws_eks_cluster" "main" {
11-
for_each = var.cluster_service_accounts
11+
for_each = { for k, v in var.cluster_service_accounts : k => v if var.create_role }
1212

1313
name = each.key
1414
}
@@ -37,7 +37,7 @@ data "aws_iam_policy_document" "assume_role_with_oidc" {
3737
}
3838

3939
dynamic "statement" {
40-
for_each = var.cluster_service_accounts
40+
for_each = { for k, v in var.cluster_service_accounts : k => v if var.create_role }
4141

4242
content {
4343
effect = "Allow"

0 commit comments

Comments
 (0)