Getting error when using serverless --stage flag. e.g., sls puresec gen-roles --stage dev to set stage: ${opt:stage} in serverless.yml.
gives warning:
Serverless Warning --------------------------------------
A valid option to satisfy the declaration 'opt:stage' could not be found.
and then throws error:
ServerlessError: Trying to populate non string value into a string for variable ${self:provider.stage}. Please make sure the value of the property is a string.
at Variables.populateVariable (/Users/dtownsend/.nvm/versions/node/v7.3.0/lib/node_modules/serverless/lib/classes/Variables.js:142:17)
at singleValueToPopulate.then.valueToPopulate (/Users/dtownsend/.nvm/versions/node/v7.3.0/lib/node_modules/serverless/lib/classes/Variables.js:108:23)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
Getting error when using serverless
--stage
flag. e.g.,sls puresec gen-roles --stage dev
to setstage: ${opt:stage}
inserverless.yml
.gives warning:
and then throws error: