terraform timeout_error ai_generated partial

Error: timeout while waiting for state to become 'AVAILABLE'

ID: terraform/apply-timeout

Also available as: JSON · Markdown
78%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1 active

Root Cause

AWS/cloud resource creation timed out. Resource may still be creating in the background.

generic

Workarounds

  1. 90% success Check the resource in AWS Console — it may still be creating
    Check the resource in AWS Console — it may still be creating

    Sources: https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts

  2. 88% success Run terraform refresh to sync state, then terraform apply
    Run terraform refresh to sync state, then terraform apply

    Sources: https://developer.hashicorp.com/terraform/cli/commands/refresh

  3. 82% success Set custom timeouts in the resource block for known slow resources
    resource "aws_rds_instance" "db" {
      ...
      timeouts { create = "60m" }
    }

    Sources: https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts

Dead Ends

Common approaches that don't work:

  1. Run terraform apply again immediately 70% fail

    May try to create a second resource if the first is still in progress

  2. Increase timeout to a very large value 50% fail

    May work but hides the real issue — why is it so slow?

Error Chain

Frequently confused with: