Error map

Invalid for_each argument (keys cannot be determined until apply) Terraform: Error: Invalid for_each argument — The "for_each" map includes keys derived from resource attributes that cannot be determined until apply

Terraform · layer 6, Platform & cloud

Open the full error page →

Centre: this error. First ring: errors it is linked with (8). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

Invalid for_each argument (keys cannot be determined until apply) — Terraform: Error: Invalid for_each argument — The "for_each" map includes keys derived from resource attributes that cannot be determined until apply (Terraform)Invalid for…Reference to undeclared resource — Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable (Terraform)Reference to undecl…Provider produced invalid plan / inconsistent final plan — Terraform: Error: Provider produced invalid plan — provider produced an invalid plan for aws_x.y, but we are tolerating it because it is using the legacy plugin SDK (Terraform)Provider produced i…Your query returned no results (data source) — Terraform: Error: Your query returned no results. Please change your search criteria and try again. (Terraform)Your query returned…Invalid AWS Region — Terraform: Error: Invalid AWS Region: us-east-3 / Error: configuring Terraform AWS Provider: validating provider credentials: operation error STS: GetCallerIdentity (Terraform)Invalid AWS RegionInvalid count argument (value unknown until apply) — Terraform: Error: Invalid count argument — The "count" value depends on resource attributes that cannot be determined until apply (Terraform)Invalid count argum…Error: Cycle (dependency cycle) — Terraform: Error: Cycle: aws_security_group.a, aws_security_group.b (Terraform)Error: Cycle (depen…Output refers to sensitive values — Terraform: Error: Output refers to sensitive values — a root module output containing sensitive data must be explicitly marked as sensitive (Terraform)Output refers to se…Saved plan is stale — Terraform: Error: Saved plan is stale — The given plan file can no longer be applied because the state was changed by another operation after the plan was created (Terraform)Saved plan is staleapi_version_invalid — API Error: Invalid or unsupported API version (API)api_version_invalidfeature_not_enabled — API Error: Feature not enabled for this account (feature_not_enabled / not available on your plan) (API)feature_not_enabledtest/live mismatch — API Error: a similar object exists in test mode, but a live mode key was used (API)test/live mismatchProvider produced inconsistent result after apply — Terraform: Error: Provider produced inconsistent result after apply — When applying changes to aws_x.y, provider produced an unexpected new value: Root resource was present, but now absent (Terraform)Provider produced i…No valid credential sources found (AWS provider) — Terraform: Error: No valid credential sources found — failed to refresh cached credentials, no EC2 IMDS role found / Error: configuring Terraform AWS Provider: no valid credential sources (Terraform)No valid credential…InvalidAMIID.NotFound — InvalidAMIID.NotFound: The image id '[ami-xxxx]' does not exist (AWS)InvalidAMIID.NotFou…Invalid index: The given key does not identify an element — Terraform: Error: Invalid index — The given key does not identify an element in this collection value (Terraform)Invalid index: The …PermanentRedirect — S3 PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint (AWS)PermanentRedirectInvalidKeyPair.NotFound — InvalidKeyPair.NotFound: The key pair 'x' does not exist (AWS)InvalidKeyPair.NotF…ResourceNotFoundException (DynamoDB) — DynamoDB ResourceNotFoundException: Requested resource not found (table) (AWS)ResourceNotFoundExc…Runtime.ImportModuleError — Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'x' (AWS)Runtime.ImportModul…DependencyViolation: resource has dependent objects (destroy) — Terraform: Error: deleting EC2 VPC (vpc-0abc): DependencyViolation: The vpc 'vpc-0abc' has dependencies and cannot be deleted (Terraform)DependencyViolation…UnauthorizedOperation / AccessDenied during Terraform apply — Terraform: Error: creating EC2 Instance: UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::123:user/ci is not authorized to perform: ec2:RunInstances (Terraform)UnauthorizedOperati…Unable to process file command — GitHub Actions: Error: Unable to process file command 'output' successfully. Invalid format 'x' (CI/CD)Unable to process f…Error loading state: AccessDenied (S3 backend) — Terraform: Error: Failed to load state: AccessDenied: Access Denied / Error refreshing state: AccessDenied status code: 403 (Terraform)Error loading state…Invalid value for input variable — Terraform: Error: Invalid value for variable — "instance_type" must be a t3 type / The given value is not suitable for var.x declared at variables.tf:1,1-17: string required (Terraform)Invalid value for i…No updates are to be performed — CloudFormation: No updates are to be performed (AWS)No updates are to b…toomanyrequests — toomanyrequests: You have reached your pull rate limit (Docker Hub) (Docker)toomanyrequeststhe input device is not a TTY — the input device is not a TTY (Docker)the input device is…

Directly related (8)

Reference to undeclared resourceTerraform

Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable

The configuration refers to a resource, data source, variable or module output that isn’t declared in this module.

Provider produced invalid plan / inconsistent final planTerraform

Terraform: Error: Provider produced invalid plan — provider produced an invalid plan for aws_x.y, but we are tolerating it because it is using the legacy plugin SDK

The provider changed planned values between plan and apply (a provider bug), so Terraform aborts.

Your query returned no results (data source)Terraform

Terraform: Error: Your query returned no results. Please change your search criteria and try again.

A data source (e.g. `aws_ami`, `aws_vpc`) found nothing matching its filters.

Invalid AWS RegionTerraform

Terraform: Error: Invalid AWS Region: us-east-3 / Error: configuring Terraform AWS Provider: validating provider credentials: operation error STS: GetCallerIdentity

The `region` is invalid/unavailable, or the provider can't reach AWS endpoints to validate credentials.

Invalid count argument (value unknown until apply)Terraform

Terraform: Error: Invalid count argument — The "count" value depends on resource attributes that cannot be determined until apply

`count` depends on something unknown at plan time, so Terraform can't decide how many instances to create.

Error: Cycle (dependency cycle)Terraform

Terraform: Error: Cycle: aws_security_group.a, aws_security_group.b

Resources reference each other (directly or indirectly), so Terraform can't order them.

Output refers to sensitive valuesTerraform

Terraform: Error: Output refers to sensitive values — a root module output containing sensitive data must be explicitly marked as sensitive

An output (or module output) exposes a value derived from a sensitive variable/attribute without `sensitive = true`.

Saved plan is staleTerraform

Terraform: Error: Saved plan is stale — The given plan file can no longer be applied because the state was changed by another operation after the plan was created

The state changed between `terraform plan -out` and `terraform apply planfile`.

Two steps away (19)

api_version_invalidAPI

API Error: Invalid or unsupported API version

The API version you requested — in the URL, a header or the SDK config — doesn’t exist or has been retired.

feature_not_enabledAPI

API Error: Feature not enabled for this account (feature_not_enabled / not available on your plan)

The endpoint or option exists, but your account, plan, region or project hasn’t been granted access to it.

test/live mismatchAPI

API Error: a similar object exists in test mode, but a live mode key was used

You’re using an ID, key or URL from one environment (test/sandbox) with credentials from another (live/production), or vice versa.

Provider produced inconsistent result after applyTerraform

Terraform: Error: Provider produced inconsistent result after apply — When applying changes to aws_x.y, provider produced an unexpected new value: Root resource was present, but now absent

After creating/updating a resource, the provider returned values that don't match what Terraform planned — usually a provider bug…

No valid credential sources found (AWS provider)Terraform

Terraform: Error: No valid credential sources found — failed to refresh cached credentials, no EC2 IMDS role found / Error: configuring Terraform AWS Provider: no valid credential sources

The AWS provider found no credentials (env vars, shared config, SSO, role, instance profile).

InvalidAMIID.NotFoundAWS

InvalidAMIID.NotFound: The image id '[ami-xxxx]' does not exist

The AMI ID isn’t available in this region/account — AMI IDs are regional and private AMIs must be shared.

Invalid index: The given key does not identify an elementTerraform

Terraform: Error: Invalid index — The given key does not identify an element in this collection value

You indexed a map/list/set with a key or position that doesn't exist.

PermanentRedirectAWS

S3 PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint

The request went to the wrong S3 region/endpoint for that bucket.

InvalidKeyPair.NotFoundAWS

InvalidKeyPair.NotFound: The key pair 'x' does not exist

The key pair name you passed doesn’t exist in that region (key pairs are regional).

ResourceNotFoundException (DynamoDB)AWS

DynamoDB ResourceNotFoundException: Requested resource not found (table)

The table (or index) doesn’t exist in the region/account the client is using.

Runtime.ImportModuleErrorAWS

Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'x'

Lambda couldn’t load your handler file or one of its dependencies — the package is missing from the deployment zip/layer or the h…

DependencyViolation: resource has dependent objects (destroy)Terraform

Terraform: Error: deleting EC2 VPC (vpc-0abc): DependencyViolation: The vpc 'vpc-0abc' has dependencies and cannot be deleted

Destroy failed because something else still uses the resource (ENIs, subnets, gateways, security group rules).

UnauthorizedOperation / AccessDenied during Terraform applyTerraform

Terraform: Error: creating EC2 Instance: UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::123:user/ci is not authorized to perform: ec2:RunInstances

The IAM identity used by Terraform lacks a permission needed for that resource.

Unable to process file commandCI/CD

GitHub Actions: Error: Unable to process file command 'output' successfully. Invalid format 'x'

A line written to `$GITHUB_OUTPUT`, `$GITHUB_ENV` or `$GITHUB_STATE` is not in `name=value` form — usually a multi-line value wit…

Error loading state: AccessDenied (S3 backend)Terraform

Terraform: Error: Failed to load state: AccessDenied: Access Denied / Error refreshing state: AccessDenied status code: 403

Terraform can't read/write the S3 bucket (or DynamoDB table) that stores state — IAM permissions or wrong credentials/role.

Invalid value for input variableTerraform

Terraform: Error: Invalid value for variable — "instance_type" must be a t3 type / The given value is not suitable for var.x declared at variables.tf:1,1-17: string required

A variable value failed its type or `validation` block.

No updates are to be performedAWS

CloudFormation: No updates are to be performed

You ran an update/deploy with a template and parameters identical to what’s deployed, so there’s nothing to change.

toomanyrequestsDocker

toomanyrequests: You have reached your pull rate limit (Docker Hub)

Docker Hub limits anonymous and free pulls; your IP or account has used its quota for the current window.

the input device is not a TTYDocker

the input device is not a TTY

docker run/exec was called with -t (allocate a terminal) in a context with no terminal — CI, cron, a pipe or a script.