Any way to "flatten" an object in a var?

I have an object that’s stored in a variable, and I need to include it in my Lambda env vars, e.g.:

    handler: src/rds.handler
      STAGE: ${self:custom.stage}

I’m just using the JavaScript ES6 spread operator as an example of what I want to do. How can I do this in the serverless.yml file?

1 Like