Skip to content

feat: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bds-congnguyen
Copy link

Description

Remove the object_lock_enabled attribute from the aws_s3_bucket resource, as it will force the creation of a new bucket and cannot be applied to an existing bucket. To enable object lock, using the aws_s3_bucket_object_lock_configuration resource alone is sufficient.

There is no change in other configuration, no change should be made in example/* folder

Motivation and Context

Breaking Changes

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • [x ] I have tested and validated these changes using one or more of the provided examples/* projects
  • [ x] I have executed pre-commit run -a on my pull request

Remove the `object_lock_enabled` attribute from the `aws_s3_bucket` resource, as it will force the creation of a new bucket and cannot be applied to an existing bucket.
To enable object lock, using the `aws_s3_bucket_object_lock_configuration` resource alone is sufficient.
@bds-congnguyen bds-congnguyen changed the title Update main.tf Fix: Update main.tf for avoid existing bucket recreate when enabling object_lock Jul 4, 2025
@bds-congnguyen bds-congnguyen changed the title Fix: Update main.tf for avoid existing bucket recreate when enabling object_lock Fix: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock Jul 4, 2025
@bds-congnguyen bds-congnguyen changed the title Fix: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock fix: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock Jul 6, 2025
@bds-congnguyen bds-congnguyen changed the title fix: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock feat: Update main.tf to avoid recreating the existing S3 bucket when enabling object_lock Jul 8, 2025
@bds-congnguyen
Copy link
Author

@bryantbiggs can you help me take a look on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant