Akhil Prajapati
Akhil Prajapati

Reputation: 1281

Deploy AWS Lambda + API Gateway on Different Environments (Dev, QA, Demo etc) in Single AWS Account

This might be a lame question but I am having a hard time getting an answer for this one. I have created an AWS Lambda Function which is being called from an API Gateway. I have used aws-sam for creating the template and deploying it on my AWS Account.

Now I want to deploy different versions of My Lambda + API on different environments such as Dev, QA, Demo, and Prod. But these different environments have to be on a single AWS account. Is there a way we can segregate this?

Upvotes: 2

Views: 479

Answers (1)

Thales Minussi
Thales Minussi

Reputation: 7215

Use the --stack-name attribute to dictate what environment you are deploying to.

If you want to create a stack for a given environment (dev, test, prod, etc), use:

sam deploy --template-file mytemplate.yml --stack-name dev

This will create a stack called dev with all the resources isolated on it.

Upvotes: 3

Related Questions