You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a brand new cluster from the new module version, but i get a for_each error which is not described in the readme.
Users may encounter an error such as Error: Invalid for_each argument - The "for_each" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply ...
From what i understand is the aforementioned error happens when attaching additional policies, right? and that i'm not doing, though i get the following error:
Error: Invalid for_each argument
on .terraform/modules/eks_cluster/main.tf line 208, in resource "aws_iam_role_policy_attachment""this":
208: for_each = var.create && var.create_iam_role ? toset(compact(distinct(concat([
209: "${local.policy_arn_prefix}/AmazonEKSClusterPolicy",
210: "${local.policy_arn_prefix}/AmazonEKSVPCResourceController",
211: ], var.iam_role_additional_policies)))) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Error: Invalid for_each argument
on .terraform/modules/eks_cluster/main.tf line 208, in resource "aws_iam_role_policy_attachment""this":
208: for_each = var.create && var.create_iam_role ? toset(compact(distinct(concat([
209: "${local.policy_arn_prefix}/AmazonEKSClusterPolicy",
210: "${local.policy_arn_prefix}/AmazonEKSVPCResourceController",
211: ], var.iam_role_additional_policies)))) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Error: Invalid for_each argument
on .terraform/modules/eks_cluster/modules/fargate-profile/main.tf line 47, in resource "aws_iam_role_policy_attachment""this":
47: for_each = var.create && var.create_iam_role ? toset(compact(distinct(concat([
48: "${local.iam_role_policy_prefix}/AmazonEKSFargatePodExecutionRolePolicy",
49: var.iam_role_attach_cni_policy ? local.cni_policy :"",
50: ], var.iam_role_additional_policies)))) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
Error: Invalid for_each argument
on .terraform/modules/eks_cluster/modules/fargate-profile/main.tf line 47, in resource "aws_iam_role_policy_attachment""this":
47: for_each = var.create && var.create_iam_role ? toset(compact(distinct(concat([
48: "${local.iam_role_policy_prefix}/AmazonEKSFargatePodExecutionRolePolicy",
49: var.iam_role_attach_cni_policy ? local.cni_policy :"",
50: ], var.iam_role_additional_policies)))) : toset([])
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
The text was updated successfully, but these errors were encountered:
The issue stated above persists. However, I went ahead and commented the resource "aws_iam_role_policy_attachment" but seeing other errors with respect to subnet_ids and desired size not enough .
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
I'm trying to create a brand new cluster from the new module version, but i get a for_each error which is not described in the readme.
From what i understand is the aforementioned error happens when attaching additional policies, right? and that i'm not doing, though i get the following error:
am i missing something?
Versions
Reproduction
Steps to reproduce the behavior:
Code Snippet to Reproduce
Expected behavior
Being able to create an eks cluster
Actual behavior
Error due to not-yet-known resources
Terminal Output Screenshot(s)
The text was updated successfully, but these errors were encountered: