Hi,
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:
stage: dev
name: aws
profile: ${self:custom.useProfile}
runtime: nodejs14.x
s3:
publicBucket:
name: ${self:custom.publicBucket}
publicAccessBlockConfiguration:
BlockPublicAcls: false
BlockPublicPolicy: false
RestrictPublicBuckets: false
ownershipControls:
Rules:
- ObjectOwnership: BucketOwnerEnforced
Any help is greatly appreciated!!
Thank you,
Donny