Skip to content

Commit

Permalink
fix: Skip retrieving EKS cluster data when not creating the role (#436)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
  • Loading branch information
3 people authored Jan 18, 2024
1 parent 814b8e6 commit bcdf554
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/iam-eks-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ locals {
}
data "aws_eks_cluster" "main" {
for_each = var.cluster_service_accounts
for_each = { for k, v in var.cluster_service_accounts : k => v if var.create_role }

name = each.key
}
Expand Down Expand Up @@ -37,7 +37,7 @@ data "aws_iam_policy_document" "assume_role_with_oidc" {
}

dynamic "statement" {
for_each = var.cluster_service_accounts
for_each = { for k, v in var.cluster_service_accounts : k => v if var.create_role }

content {
effect = "Allow"
Expand Down

0 comments on commit bcdf554

Please sign in to comment.