Skip to content

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?

@bryantbiggs
Copy link
Member

I don't understand the PR - we'll need a reproduction

also, if this were an issue I would expect to see more users reporting it as such

@baolsen
Copy link

baolsen commented Aug 13, 2025

Please see related upstream issue / discussion
hashicorp/terraform-provider-aws#36530

@bryantbiggs
Copy link
Member

thank you @baolsen - closing since this appears to be a provider issue

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants