aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

New-S3Bucket should support Enabling Object Lock #158

Closed mikereinhold closed 3 years ago

mikereinhold commented 4 years ago

Currently the New-S3Bucket cmdlet does not have an option for enabling object lock when creating bucket. Object lock can only be activated during bucket creation (without going to AWS Support).

Expected Behavior

Since Object Lock can only be enabled on a bucket during bucket creation, it's pretty important for the New-S3Bucket command to include this capability.

New-S3Bucket -BucketName my-sample-bucket -EnableObjectLock

Possible Solution

The Object Lock setting on a bucket is strictly Enabled/Disabled at time of bucket creation. The default object locking settings (governance vs legal hold vs none) are configured separately and after the fact.

Add a switch parameter to the New-S3Bucket cmdlet that when used adds the x-amz-bucket-object-lock-enabled request parameter.

S3 CreateBucket API Reference

Context

Since Object Lock must be specified at time of bucket creation, we are forced to create the bucket via other means. Object lock during bucket creation seems to be a common gap across tooling right now, so we're manually creating via the console.

Your Environment

Include as many relevant details about the environment where the bug was discovered.

ashishdhingra commented 3 years ago

This is fixed in AWS.Tools.S3 4.1.13.0.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.