Skip to content

How to deploy a specific function using AWS SAM?

1

Hello everyone,

I'm currently working with the AWS Serverless Application Model (SAM) to manage my Lambda functions. I'd like to know if it's possible to deploy a specific Lambda function within my SAM template without deploying the entire stack all at once.

I have several functions defined in my template.yaml, and I often make changes to a single function. Deploying the entire stack just to update one function seems a bit excessive and takes more time than I'd like.

Could you guide me on how to deploy just one specific function using AWS SAM? What commands and/or parameters should I use to achieve this?

Thank you in advance for your help!

1 Answer
2
Accepted Answer

Hello.

I think that only the changed parts are deployed when updating.
To achieve your requirements, the only option is to split the SAM template for each Lambda function and deploy them separately.
It is not possible to deploy only some resources using command options.
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.