Terraform: docs: Add example S3 locking config with DynamoDb table

Created on 5 Apr 2017  ยท  6Comments  ยท  Source: hashicorp/terraform

The S3 Backend docs mention that locking can be done with a DynamoDB table, but we don't provide any example of how to do so:

If possible we should add the full example config, right above configuration:

backens3 documentation

Most helpful comment

It is a year and a half later, and nothing has been added to the documentation. When you create a DynamoDB table, you are required to specify the hash key, and the only documentation of this is in a comment in a ticket in github.

In the documentation for the S3 backend, there is a statement: "... which can be enabled by setting the dynamodb_table field to an existing DynamoDB table name." Is it really so difficult not to add just a few more words there to specify the requirements of this table so the documentation is actually useful?

Did this fall through the cracks? Documentation for terraform is generally top-notch, but omissions like this are paper-cuts that waste time trying to use the tool.

All 6 comments

I am creating table terraform_states in DynamoDB, stumbled on "primary key". Anyone can provide an example on how to create dynamoDB table???

@kl-cheng, check this comment:
https://github.com/hashicorp/terraform/issues/12877#issuecomment-289920798

It is a year and a half later, and nothing has been added to the documentation. When you create a DynamoDB table, you are required to specify the hash key, and the only documentation of this is in a comment in a ticket in github.

In the documentation for the S3 backend, there is a statement: "... which can be enabled by setting the dynamodb_table field to an existing DynamoDB table name." Is it really so difficult not to add just a few more words there to specify the requirements of this table so the documentation is actually useful?

Did this fall through the cracks? Documentation for terraform is generally top-notch, but omissions like this are paper-cuts that waste time trying to use the tool.

In the Configuration Variables section there is this:

_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._

I didn't notice it at first ... but seems clear enough???

Yup, at the time lock_table was the configuration option and the requirements for that table were not documented. However, now that is deprecated in favor of dynamodb_table, and appears documentation has been added to clarify. Also seems clear to me how to use it, so this issue is probably resolvable?

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings