I am trying to modify one of the buckets that is attached to the lambda function that my serverless.yml deploys. I am trying to configure the object ownership to be “BucketOwnerPreferred”. Referencing AWS documentation ( AWS::S3::Bucket OwnershipControls - AWS CloudFormation (amazon.com)) I would use the variable “ownershipControls” (lowercase o because I am modifying the property inline and not in the ‘resources’ section).
However, this variable is not recognized. Am I calling it wrong here? Code block is as follows:
provider:
# If you need to configure the bucket itself, you'll need to add s3 resources to the provider configuration
s3:
# Eventual additional properties in camel case
bucketOne:
# Supported properties are the same ones as supported by CF resource for S3 bucket
# See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html
name: my-custom-bucket-name
versioningConfiguration:
Status: Enabled
So it seems like this should work, but it doesn’t.
If I remove the ownershipControls: section then everything deploys but the Object Ownership on the created bucket is Object writer instead of Bucket owner preferred