All:
Has anyone figured out a good way to handle typed variables in the new serverless.ts format?
eg:
In the yaml format, because of processing, you could do things like this
custom:
scheduled:
prod: true
dev: false
.
.
.
events:
schedule:
rate: 2(mins)
enabled: "${self:custom.scheduled.${opt:stage}"
.
.
.
Because of the way the TS is parsed this is not really an option anymore. Has anyone determined a great way of using custom variables in the new serverless.ts
when the typing is forced?
In summary: I want to turn things on/off depending on the stage used for deployment & maybe I am approaching this incorrectly
TLDR: scheduled.enabled
is a boolean and needs to be a boolean at transpile time but the string values are not parsed until runtime
Thanks!