Serverless Framework - Variables resolution error
There is a slight change in variables resolution and in your case, the best way to resolve it would be to use the following syntax:
custom:
S3_BUCKET_NAME: ${self:service}-data-${sls:stage}
s3Sync:
- bucketName: ${self:custom.S3_BUCKET_NAME}-website
localDir: ./dist
deleteRemoved: true
for resolving the stage. Alternatively, you can use old syntax, but provide explicit fallback value for stage:
custom:
S3_BUCKET_NAME: ${self:service}-data-${opt:stage, self:provider.stage, 'dev'}
s3Sync:
- bucketName: ${self:custom.S3_BUCKET_NAME}-website
localDir: ./dist
deleteRemoved: true
I would recommend going with sls:stage
version.