I expected CloudFormation to honor the provided configuration, without adding any extra properties that are optional.
Observed Behavior
CloudFormation reserved the right to automatically append additional properties to your S3 CORS policy, despite them being optional.
Although the inclusion of "ExposeHeaders": [] might be considered harmless, the same cannot be said for "MaxAgeSeconds": 0.
This setting prevents the browser from caching, as opposed to when the property is not specified, allowing the browser to default to its standard caching period.
Name of the resource
AWS::S3::Bucket
Resource Name
No response
Issue Description
Adding the following CORS Policy from the S3 AWS Console is valid:
Yet, if you try to apply the exact same configuration through CloudFormation:
This is what you would end up with:
Expected Behavior
I expected CloudFormation to honor the provided configuration, without adding any extra properties that are optional.
Observed Behavior
CloudFormation reserved the right to automatically append additional properties to your S3 CORS policy, despite them being optional.
Although the inclusion of
"ExposeHeaders": []
might be considered harmless, the same cannot be said for"MaxAgeSeconds": 0
. This setting prevents the browser from caching, as opposed to when the property is not specified, allowing the browser to default to its standard caching period.Test Cases
See above.
Other Details
No response