Referencing SSM and CLI options in serverless.js and .ts

Hi Everyone!

I’ll preface my question with: I know there’s already a guide to configure a serverless stack with a serverless.yml file, but there’s no guide to do it with other file formats such as serverless.js or serverless.ts … The only thing I saw in the docs are:

For the sake of simplicity, most code snippet detailed in this documentation only refer to the serverless.yml YAML service file format. However, all functionalities work as well in the other available service file formats.

So my question is, in a .js or a .ts file, is there a way for me to reference CLI options (like the opt reference in yml) or even the ssm tag if I’m referencing something from ssm? There’s nothing in the docs about this.

I’ve tried stuff like this but all failed.

  • '${ssm:/some/api/api-key, ""}'
  • stage: '${self:provider.stage}'