Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 1.29 KB

lock.md

File metadata and controls

32 lines (19 loc) · 1.29 KB

Lock Backends

The lock backend takes care of locking a specific state file, so that only one Terraform entity can access and change it in a given time.

Local Map

This is the simplest implementation by using a local Golang map and doesn't require any configuration. It works fine for a standalone, single-instance Terraform backend server, but doesn't scale. Also if the Terraform backend server crashes, the lock information will be lost.

Config

Set LOCK_BACKEND to local.

Redis

This backend uses an external Redis server to lock the states. It's scalable and can be used also with multiple Terraform backend server instances.

Config

Set LOCK_BACKEND to redis.

Make sure that the Redis client is set up properly.

Postgres

This backend uses an external Postgres server to lock the states. It's scalable and can be used also with multiple Terraform backend server instances.

Config

Set LOCK_BACKEND to postgres.

Environment Variable Type Default Description
LOCK_POSTGRES_TABLE string locks The table name used for storing locks

Make sure that the Postgres client is set up properly.