In the serverless.yml
file, I was using interpolation to generate stage value. And I got the following errors after running sls deploy
.
# serverless.yml
provider:
name: aws
runtime: nodejs6.10
memorySize: 512
timeout: 30
stage: ${self:custom.CONFIG.STAGE, 'dev'}
region: ${self:custom.CONFIG.REGION}
custom:
CONFIG: ${file(config.yml):env}
# config.yml
env:
STAGE: dev
REGION: ap-southeast-2
# Error log
Serverless: 'Too many requests' received, sleeping 5 seconds
Serverless: 'Too many requests' received, sleeping 5 seconds
Serverless: 'Too many requests' received, sleeping 5 seconds
Serverless Error ---------------------------------------
Stage name only allows a-zA-Z0-9_
This error can be fixed by using static values like ‘dev’ or ‘production’.