---
title: "Terraform state in Gyro storage"
description: "The Terraform s3 backend works with both Gyro storage products; they differ in state locking (use_lockfile, Terraform 1.10+), which needs conditional writ"
url: https://www.gyrohosting.com/developers/en/guides/terraform-state.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.40.0
---

# Terraform state in Gyro storage

The Terraform `s3` backend works with both Gyro storage products; they differ in **state locking** (`use_lockfile`, Terraform 1.10+), which needs conditional writes (`If-None-Match: *`):

|  | Endpoint | use_lockfile |
|---|---|---|
| **Protected Storage** (recommended) | `https://s3-kilit.gyrohosting.com` | works (a second run gets 412 and stops); old state versions are kept |
| Object Storage | `https://s3.gyrohosting.com` | **not enforced**: leave it out and apply from one runner at a time |

```
terraform {
  backend "s3" {
    bucket    = "gyro-proje-tfstate"
    key       = "prod/terraform.tfstate"
    region    = "tr-ist-1"
    endpoints = { s3 = "https://s3-kilit.gyrohosting.com" }
    use_path_style              = true
    use_lockfile                = true
    skip_credentials_validation = true
    skip_region_validation      = true
    skip_requesting_account_id  = true
    skip_metadata_api_check     = true
    skip_s3_checksum            = true
  }
}
```

Credentials: an access key of the service as `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`. Measured 15 Nov 2026 with two concurrent applies.
