Skip to content
Latchkey

Terraform AWS provider "timeout while waiting for state to become available" in CI

The AWS provider created the resource and then polled until it should report a ready state, but the resource never reached it within the timeout. The create call succeeded; the readiness wait did not.

What this error means

terraform apply fails with "error waiting for <Resource> (<id>) to become ready: timeout while waiting for state to become 'available' (last state: 'pending', timeout: 10m0s)".

Terraform
Error: waiting for RDS DB Instance (app-db) create: timeout while
waiting for state to become 'available' (last state: 'creating',
timeout: 40m0s)

Common causes

The resource genuinely takes longer than the timeout

Large RDS instances, NAT gateways, or clusters can take longer to become available than the provider's default wait.

The resource is stuck in an error state

The resource entered a failed or rolling-back state, so it will never reach available and the wait runs out.

How to fix it

Raise the resource create timeout

Give slow resources more time with a timeouts block instead of failing at the default.

main.tf
resource "aws_db_instance" "app" {
  # ...
  timeouts {
    create = "60m"
  }
}

Inspect the real resource state

  1. Describe the resource in AWS to see its actual status and any failure reason.
  2. If it is stuck failed, fix the cause (quota, config) and recreate.
  3. If it is just slow, the longer timeout resolves it.
Terminal
aws rds describe-db-instances \
  --db-instance-identifier app-db \
  --query 'DBInstances[0].DBInstanceStatus'

How to prevent it

  • Set realistic timeouts for resources known to be slow.
  • Check quotas before creating large resources.
  • Distinguish a slow create from a stuck failed state by describing it.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →