travis-ci/terraform-config

Automatic locking of remote state file

Closed this issue · 0 comments

According to the Terraform docs, the s3 backend supports state locking and consistency checking via Dynamo DB, which can be enabled by setting the dynamodb_table field to an existing DynamoDB table name.

dynamodb_table - (Optional) The name of a DynamoDB table to use for state locking and consistency. The table must have a primary key named LockID. If not present, locking will be disabled.

In order to enable automatic locking we thus need to:

  • Create a DynamoDB table in us-east-1 with a primary key named LockID
  • Add the dynamodb_table key to the relevant backend configs, e.g. here

If there are no objections, I can work on this!