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

**Code:** `timeout while waiting for state to become 'available'` · **Category:** Terraform · **Seen on:** Terraform

The resource didn't reach the target state before the provider's timeout.

## Meaning

Large resources (RDS, EKS, CloudFront) take long. Increase the timeout with a `timeouts {}` block (`create = "90m"`), investigate if it's truly stuck (cloud console events: quota, subnet/IP exhaustion, permission failures), and rerun apply — Terraform will continue/replace a tainted resource. Check dependencies like KMS keys or networking.

## Common causes

- Slow creation exceeding default timeout
- Provisioning stuck due to quota/capacity
- Subnet/IP exhaustion or networking misconfig
- Missing permissions (service-linked roles)
- Cloud outage/throttling

## Quick fix

1. Add `timeouts { create = "90m" }`
2. Inspect the cloud console/events for the real error
3. Re-run `terraform apply`; handle `tainted` resources

## Detailed fix by platform

### Terraform

1. `resource "aws_db_instance" "db" { ... timeouts { create = "90m" delete = "60m" } }`

## How to diagnose

1. **Last state** — Stuck or slow?
2. **Console** — Events?
3. **Timeout** — Large enough?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/timeout-while-waiting-for-state)
