Closed mikereinhold closed 3 years ago
Reproducible using the below commands:
Write-S3BucketInventoryConfiguration
$bucketName = "example-test-overflow-bucket-159"
$inventoryId = "overflow-example-159"
Write-S3BucketInventoryConfiguration -BucketName $bucketName -InventoryConfiguration_InventoryId $inventoryId -InventoryEncryption_SSES3 ([Amazon.S3.Model.SSES3]::new()) -Schedule_Frequency "Daily" -S3BucketDestination_BucketName "arn:aws:s3:::$bucketName" -S3BucketDestination_Prefix "inventory" -S3BucketDestination_InventoryFormat "CSV"
Get-S3BucketInventoryConfiguration (Prerequisite: manually set the similar configuration as above from AWS Console)
$bucketName = "example-test-overflow-bucket-159"
$inventoryId = "overflow-example-159"
$inventoryConfig = Get-S3BucketInventoryConfiguration -BucketName $bucketName -InventoryId $inventoryId
$inventoryConfig.Destination.S3BucketDestination.InventoryEncryption
Following works in AWS CLI:
aws s3api put-bucket-inventory-configuration --bucket example-test-overflow-bucket-159 --id overflow-example-159 --inventory-configuration '{"Destination": {"S3BucketDestination":{"Bucket":"arn:aws:s3:::example-test-overflow-bucket-159", "Format":"CSV", "Prefix":"inventory", "Encryption": {"SSES3":{}}}}, "Id": "overflow-example-159", "IsEnabled": true, "Schedule": {"Frequency": "Daily"}, "IncludedObjectVersions": "All"}'
Kindly note that IsEnabled
and IncludedObjectVersions
properties are required.
The following PowerShell commands works in the latest version of AWS Powershell Tools (4.1.6.0
):
Write-S3BucketInventoryConfiguration
$bucketName = "example-test-overflow-bucket-159"
$inventoryId = "overflow-example-159"
Write-S3BucketInventoryConfiguration -BucketName $bucketName -InventoryId $inventoryId -InventoryConfiguration_InventoryId $inventoryId -InventoryEncryption_SSES3 ([Amazon.S3.Model.SSES3]::new()) -Schedule_Frequency "Daily" -S3BucketDestination_BucketName "arn:aws:s3:::$bucketName" -S3BucketDestination_Prefix "inventory" -S3BucketDestination_InventoryFormat "CSV" -InventoryConfiguration_IsEnabled $True -InventoryConfiguration_IncludedObjectVersions "All"
NOTE:
-InventoryId
parameter as well.-InventoryConfiguration_IsEnabled
and -InventoryConfiguration_IncludedObjectVersions
parameters are required.Get-S3BucketInventoryConfiguration
$bucketName = "example-test-overflow-bucket-159"
$inventoryId = "overflow-example-159"
$inventoryConfig = Get-S3BucketInventoryConfiguration -BucketName $bucketName -InventoryId $inventoryId
$inventoryConfig.Destination.S3BucketDestination.InventoryEncryption
When attempting to access or set bucket inventory encryption configuration, the command crashes with a stack overflow.
Expected Behavior
When accessing the bucket inventory configuration, the inventory encryption configuration should be returned.
When writing the bucket inventory configuration, the inventory encryption configuration should be built and applied to the bucket.
Current Behavior
When accessing the bucket inventory configuration or attempting to write the bucket inventory configuration, a stack overflow occurs.
No stack trace or other debugging information is provided, simply a single line output to the console "Stack overflow." and the session is dead.
Steps to Reproduce (for bugs)
Also occurs when a bucket has been configured to use encrypted inventory (via another method, aka console) and you attempt to access the inventory encryption configuration
Context
Trying to automate standard bucket configurations for use in our organization to ensure we have consistent configuration and process.
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