Loading...
Loading...
### Terraform Version ```shell Terraform v1.10.3 on darwin_arm64 ``` ### Terraform Configuration Files ``` provider "aws" { region = "ap-east-1" } terraform { required_version = ">= 0.13" } resource "null_resource" "check_cluster" { provisioner "local-exec" { command = "echo 123> output.txt" } triggers = { id = timestamp() } } data "local_file" "output" { filename = "output.txt" depends_on = [null_resource.check_cluster] } resource "aws_eks_access_entry" "eks" { count = data.local_file.output.content == "123" ? 1 : 0 cluster_name = "eks-cluster" principal_arn = "xxxxxxx" } resource "aws_eks_access_policy_association" "eks" { count = data.local_file.output.content == "123" ? 1 : 0 cluster_name = "eks-cluster" policy_arn = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy" principal_arn = "xxxxxxxx" access_scope { type = "cluster" } } ``` ### Debug Output ` terraform plan ` ### Expected Behavior Proper operation plan ### Actual Behavior ``` Plan: 1 to add, 0 to change, 0 to destroy. ╷ │ Error: Invalid count argument │ │ on main.tf line 25, in resource "aws_eks_access_entry" "eks": │ 25: count = data.local_file.output.content == "123" ? 1 : 0 │ │ The "count" 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 count depends on. ╵ ╷ │ Error: Invalid count argument │ │ on main.tf line 31, in resource "aws_eks_access_policy_association" "eks": │ 31: count = data.local_file.output.content == "123" ? 1 : 0 │ │ The "count" 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 count depends on. ``` ### Steps to Reproduce 1. terraform init 2. terraform plan ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.