Terraform state storage cost: cheap backend, watch the locking
Terraform remote state on S3, GCS, or Azure Blob costs almost nothing, tiny storage plus a few requests per run. The only real cost is state locking (a DynamoDB table on AWS) and, at scale, request volume. Here is the tiny model.
Quick answer
Terraform remote state stored on S3, Google Cloud Storage, or Azure Blob costs almost nothing: state files are tiny, and each run makes only a few storage requests, so the storage and request charges are negligible. The only notable cost is state locking, which on AWS uses a DynamoDB table (on-demand, a few cents), and at very large scale, request volume from many frequent runs. For virtually all teams, state storage is a rounding error.
A common question when setting up Terraform remote state is what it will cost. The reassuring answer is: almost nothing. State files are small, runs make only a handful of requests, and the backends (object storage) are cheap per gigabyte and per request. The cost is negligible for virtually every team, but it is worth understanding the pieces.
The tiny components
| Component | Cost |
|---|---|
| State file storage | Tiny (a few KB to MB per state) |
| Requests per run | A few reads/writes, negligible |
| Locking (DynamoDB on AWS) | On-demand, a few cents |
A Terraform state file is typically kilobytes to a few megabytes, so storage on S3, GCS, or Blob costs fractions of a cent per month. Each run reads and writes state a few times, so request charges are negligible. On AWS, state locking uses a DynamoDB table to prevent concurrent runs corrupting state, which on on-demand capacity costs a few cents for typical usage. GCS and Azure Blob provide locking natively without a separate resource.
Where it could add up (barely)
At very large scale, hundreds of state files, or CI running Terraform very frequently, request volume and the DynamoDB lock table could reach a few dollars a month. Even then it is trivial relative to the infrastructure the state describes. There is essentially no scenario where state storage is a cost concern.
Setting up state sensibly
Use a remote backend (S3 with DynamoDB locking, GCS, or Azure Blob) for team collaboration and safety, not for cost reasons, it is effectively free. Enable versioning on the state bucket (cheap and valuable for recovery), use DynamoDB on-demand for the lock table rather than provisioned, and do not over-think the cost. The value of remote state, collaboration, locking, safety, vastly outweighs its trivial price. The real Terraform cost story is the infrastructure the state describes, not the state itself.
FAQ
How much does Terraform state storage cost?
Almost nothing. State files are tiny (kilobytes to a few megabytes), so storage on S3, GCS, or Azure Blob costs fractions of a cent per month, and each run makes only a few requests. The only notable component is state locking (a DynamoDB table on AWS, a few cents), and even at large scale it totals a few dollars at most.
Does Terraform state locking cost extra?
On AWS, state locking uses a DynamoDB table to prevent concurrent runs from corrupting state, which on on-demand capacity costs a few cents for typical usage. GCS and Azure Blob provide locking natively without a separate billed resource, so locking is either free or a few cents depending on the backend.
Should I worry about Terraform state storage cost?
No. State storage is a rounding error, fractions of a cent for storage, negligible requests, and a few cents for locking, so it is trivial relative to the infrastructure the state describes. Use a remote backend for collaboration and safety, not to save on state cost, which is effectively zero.
What is the cheapest Terraform backend?
They are all effectively free: S3, GCS, and Azure Blob all store tiny state files for fractions of a cent and handle a few requests per run. S3 adds a DynamoDB lock table costing a few cents; GCS and Azure Blob lock natively. Choose the backend on the cloud you use, not on cost, since the difference is negligible.
Can Terraform state storage ever be significant?
Only in extreme cases, hundreds of state files or CI running Terraform very frequently, might push request volume and the lock table to a few dollars a month, still trivial relative to the infrastructure managed. There is essentially no realistic scenario where state storage is a meaningful cost concern.
Does C3X estimate Terraform state cost?
State storage is negligible, so it is not where cost estimation matters. C3X focuses on the real Terraform cost story, the infrastructure your configuration describes, pricing that before deploy. The state backend that stores your Terraform state is effectively free by comparison.
What to do next
The real cost is the infrastructure, not the state. C3X prices your Terraform before deploy against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.