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)".
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.
resource "aws_db_instance" "app" {
# ...
timeouts {
create = "60m"
}
}Inspect the real resource state
- Describe the resource in AWS to see its actual status and any failure reason.
- If it is stuck failed, fix the cause (quota, config) and recreate.
- If it is just slow, the longer timeout resolves it.
aws rds describe-db-instances \
--db-instance-identifier app-db \
--query 'DBInstances[0].DBInstanceStatus'How to prevent it
- Set realistic
timeoutsfor resources known to be slow. - Check quotas before creating large resources.
- Distinguish a slow create from a stuck failed state by describing it.