Closed mikereinhold closed 3 years ago
This is fixed in AWS.Tools.S3 4.1.13.0.
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.
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.
Get-AWSPowerShellVersion
: 4.0.5.0$PSVersionTable.OS
: Microsoft Windows 10.0.18363$PSVersionTable.PSEdition
: Core 7.0.1