add support for S3 object based TF state lock#192
Merged
milldr merged 6 commits intocloudposse:mainfrom Aug 13, 2025
Merged
Conversation
Member
|
/terratest |
milldr
approved these changes
Aug 12, 2025
Member
milldr
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the contribution!
Contributor
|
Thanks for considering and handling the PR. |
goruha
approved these changes
Aug 13, 2025
|
These changes were released in v1.6.0. |
| tags = module.this.tags | ||
| } | ||
|
|
||
| resource "aws_s3_bucket_object_lock_configuration" "default" { |
There was a problem hiding this comment.
@smangels @plejd-sebman Not sure if this is the place to ask but I have this doubt. If TF S3 state locking use_lockfile property depends merely on s3 conditional writes. Why do we need this?
Contributor
|
@jludiansonatype this is required so that Terraform will be able to make use of native S3 state lock and for this a lock configuration has to be created. Otherwise this features is disabled on S3 objects in that bucket. Is there a special case where this solution doesn't work? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
This PR provides the code changes necessary to support Terraform state lock based on S3 object locks. It is closes #184 . I've decided to create the branch from release
v1.5.0. Note that the change allow for smooth migration by keeping the DynamoDB related resources in place until all dependent deployments using the same framework have been migrated. After that the DynamoDB related switch can be changed to FALSE.why
The Hashicorp Terraform project has marked the DynamoDB-based state lock as 'deprecated' and encourages the new TF state lock mechanism.
references
https://github.com/hashicorp/terraform/blob/v1.11/CHANGELOG.md#1110-february-27-2025