I’m curious, is it possible to get hold of CLI options like the deployment stage from within the file but outside the configuration?
I.e. I think I could do something like:
stage: '${opt:stage, self:provider.stage}',
within the Serverless configuration definition.
But can I get access to the stage that’s being used outside of the configuration but within the serverless.ts file?
e.g.
import type { Serverless } from 'serverless/aws';
console.log('${opt:stage, self:provider.stage}'); // how to do this?
const serverlessConfiguration: Serverless = {
...
}