I am attempting to solve a few of the deprecation warnings that have been coming up when running npx serverless package.
There is a function in the serverless.yml
file that has a conditional property on it to be able to decide which bucket is used. eg.
resources:
Conditions:
isFirstBucketEmtpy: !Equals [!Ref SecondBucket, ""]
functions:
functionName:
handler: handler/path
events:
- s3:
bucket: !If [ isFirstBucketEmtpy, !Ref FirstBucket, !Ref SecondBucket ]
event: s3:ObjectCreated:*
rules:
- prefix: prefix/here
existing: true
This syntax has been working ok and resolving fine in the cloudformation code eg.
"BucketName": {
"Fn::If": [
"isFirstBucketEmtpy",
{
"Ref": "FirstBucket"
},
{
"Ref": "SecondBucket"
}
]
},
The warning that is shown is:
Configuration warning at 'functions.functionName.events[0].s3.bucket': unsupported object format
Would be great to know what the actual syntax is for this issue, as aware on the next release this will instead throw an error ( Service configuration validation)