Allyl Isocyanate
Allyl Isocyanate

Reputation: 13626

Deploying multiple CloudFormation stacks from a single serverless.yml template?

When I do an sls deploy, I ended up with a CloudFormation stack named <name of service>-<stage>.

I would like to deploy multiple CloudFormation stacks using the same template. One way this could work is based on an environment variable. Something like:

SOURCE=twitter sls deploy

...would yield a cloud formation stack named <name of service>-<SOURCE env var>-<stage>, which in this case would be scrape-twitter-prod.

Is this possible?

Upvotes: 1

Views: 803

Answers (1)

kichik
kichik

Reputation: 34744

According to the documentation you can reference environment variables with ${env:VARIABLE}. You can then do something like:

service: scrape-${env:SOURCE}

Upvotes: 1

Related Questions