N/A
N/A
N/A
N/A
https://www.terraform.io/docs/backends/types/s3.html#dynamodb_table
The documentation should specify whether the same DynamoDB table can be used by multiple AWS providers to lock multiple state files. e.g., can I create one DynamoDB table in my account, call it terraform-lock
, and specify it as the dynamodb_table
parameter in every AWS provider I create?
The documentation does not make it clear whether one DynamoDB table can lock all state files stored in that AWS account, or whether each state file needs its own one-row DynamoDB table.
The answer probably seems obvious to the person who wrote the module, but it's not obvious to the end-user.
N/A (Read the documentation? :smile:)
N/A
N/A
Same question here. Can I manage multiple state files via the same DynamoDB table, by giving each TF config a separate key?
Would also be interested in seeing an update for this.
For anyone looking for the answer, it's yes: the same DynamoDB table can lock as many S3 remote state files as you want. It creates a separate row in the table for each state file.
I haven't tested this for different state buckets, only for different state files stored in the same bucket.
It would still be nice to see this information added to the documentation.
To extend @geekofalltrades's answer, you can use the same DDB table for different state file buckets: the lock key in the DDB table is prefixed with the bucket name.
The linked PR should have closed this issue, so I'll do so now. Thanks!
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.
Most helpful comment
For anyone looking for the answer, it's yes: the same DynamoDB table can lock as many S3 remote state files as you want. It creates a separate row in the table for each state file.
I haven't tested this for different state buckets, only for different state files stored in the same bucket.
It would still be nice to see this information added to the documentation.