How to fix timeout while waiting for state to become ready in Terraform

TerraformINTERMEDIATEMEDIUMUpdated Dec 30, 2025ยท 183 views

This error occurs when Terraform times out waiting for a resource (especially AWS routes) to reach its desired state. The operation exceeds the timeout threshold, often due to misconfigured timeouts, network issues, or provider bugs.

Quick fix

Fixes timeout while waiting for state to become ready

resource "aws_route" "example" {
  route_table_id            = aws_route_table.example.id
  destination_cidr_block    = "0.0.0.0/0"
  gateway_id                = aws_internet_gateway.example.id

  timeouts {
    create = "5m"
    update = "5m"
    delete = "5m"
  }
}
  1. Increase the timeout in your Terraform configuration
  2. Check the resource status in the cloud provider console
  3. Verify network connectivity and API access
  4. Increase provider-level retry configuration (AWS)
terraform โ€” error
resource "aws_route" "example" {
route_table_id = aws_route_table.example.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.example.id
timeouts {
create = "5m"
update = "5m"
delete = "5m"
}
}
timeout while waiting for state to become ready

What this error means

When Terraform provisions or updates resources, it polls the cloud provider API to verify the resource has reached its desired state. This error means Terraform waited longer than the configured timeout period (default 2-10 minutes depending on resource type) without the resource completing the operation. The timeout can be explicitly configured in your Terraform code, but if the resource is slower than expected or the timeout configuration is ignored by the provider, you see this error.

Typical symptoms

  • Terraform apply or destroy operations fail with "timeout while waiting for state to become ready" error
  • Operations fail at exactly the timeout duration (e.g., 2m0s) even if you set longer timeouts
  • Partial infrastructure is created but the deployment halts
  • Resource is actually being created in the cloud provider but Terraform gives up waiting
  • Error appears after waiting for specific resources like aws_route, aws_instance, or database instances

Common causes

  1. Configured timeouts are ignored by the Terraform provider (provider bug)
  2. Resource operation genuinely takes longer than the timeout period
  3. Network latency or connectivity issues delay state polling
  4. Cloud provider API throttling slowing down resource provisioning
  5. Insufficient capacity in the availability zone or region
  6. Misconfigured resource dependencies causing sequential delays
  7. Cloud provider service is experiencing degraded performance or outages

How to fix "timeout while waiting for state to become ready"

1Increase the timeout in your Terraform configuration

Add or modify the timeouts block on the resource to allow more time for provisioning:

hcl
resource "aws_route" "example" {
  route_table_id            = aws_route_table.example.id
  destination_cidr_block    = "0.0.0.0/0"
  gateway_id                = aws_internet_gateway.example.id

  timeouts {
    create = "5m"
    update = "5m"
    delete = "5m"
  }
}

For other AWS resources, adjust the timeouts block accordingly. Some resources support different timeout operations (create, update, delete).

2Check the resource status in the cloud provider console

Log into your AWS Management Console (or applicable cloud provider) and verify the resource is actually being created despite the timeout:

1. Navigate to the relevant service (EC2, Route Tables, RDS, etc.)
2. Search for the resource by name or ID
3. Check the resource state (running, available, pending, etc.)
4. If the resource exists and is in the desired state, the issue is just a timeout waiting, not a failed creation
5. If the resource is stuck in a "pending" or intermediate state, investigate cloud provider logs

If the resource exists, you can import it into your Terraform state to continue: terraform import <resource-type>.<name> <resource-id>

3Verify network connectivity and API access

Ensure Terraform can reach the cloud provider API:

1. Check if your internet connection is stable
2. Verify firewall and security group rules allow outbound HTTPS (port 443) access
3. Check if the cloud provider is experiencing an outage (check their status page)
4. If using a proxy, ensure it's properly configured in your Terraform environment
5. Run terraform plan to verify provider authentication is working correctly

Network latency can compound and cause operations to exceed timeout limits.

4Increase provider-level retry configuration (AWS)

For AWS, configure retry behavior at the provider level:

hcl
provider "aws" {
  region      = "us-east-1"
  retry_mode  = "standard"
  max_retries = 25
}

The standard retry mode uses exponential backoff for transient errors. The max_retries setting controls how many times failed API calls are retried before giving up.

5Reduce resource complexity or dependencies

Simplify your infrastructure design to reduce provisioning time:

1. Break large deployments into smaller modules
2. Remove unnecessary resource dependencies
3. Use parallel resource creation by removing depends_on relationships where possible
4. Create resources in stages rather than all at once
5. For large databases or instances, pre-allocate sufficient capacity

Large or complex deployments can take longer due to cascading operations. Running terraform apply -parallelism=5 can help multiple resources provision simultaneously.

6Update your Terraform provider version

This error was a known bug in older AWS provider versions. Update to the latest version:

hcl
required_providers {
  aws = {
    source  = "hashicorp/aws"
    version = "~> 5.0"  # Use latest stable version
  }
}

Then run:

bash
terraform init -upgrade
terraform apply

Higher provider versions include fixes for timeout handling and better state polling logic.

Advanced notes

The timeout issue is particularly common with aws_route resources in older AWS provider versions (pre-v5.0), where the provider was not properly respecting configured timeout values and would default to 2 minutes regardless of settings. This was a known bug that was fixed in later versions. If you're using timeouts but they're still being ignored, check your provider version first. For aws_route specifically, routes can take 10-15 seconds to become "ready", but network conditions can extend this. Setting timeouts to at least 5 minutes is recommended for production deployments. Additionally, some resources like RDS instances can legitimately take 30+ minutes to provision, so account for this in your timeout configuration.

Frequently asked questions

What does "timeout while waiting for state to become ready" mean?
When Terraform provisions or updates resources, it polls the cloud provider API to verify the resource has reached its desired state. This error means Terraform waited longer than the configured timeout period (default 2-10 minutes depending on resource type) without the resource completing the operation. The timeout can be explicitly configured in your Terraform code, but if the resource is slower than expected or the timeout configuration is ignored by the provider, you see this error.
How do I fix "timeout while waiting for state to become ready"?
This error occurs when Terraform times out waiting for a resource (especially AWS routes) to reach its desired state. The operation exceeds the timeout threshold, often due to misconfigured timeouts, network issues, or provider bugs.
What causes "timeout while waiting for state to become ready"?
Configured timeouts are ignored by the Terraform provider (provider bug) Resource operation genuinely takes longer than the timeout period Network latency or connectivity issues delay state polling
Is the "timeout while waiting for state to become ready" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading