3

I have a serverless framework service with (say)five aws lambda functions using python. By using github I have created a CodePipeline for CI/CD.

When I push the code changes, it deploys all the functions even only function is changed.

I want to avoid the deployment of all functions and the CI/CD should determine the changed function and deploy it. Rest of functions should not be deployed again.

Moreover, is there anyway to deal with such problems using AWS SAM, as at this stage I have an option to switch towards SAM by quitting serverless framework

0

2 Answers 2

1

Unfortunately there is no "native" way to do it. You would need to write a bash that will loop through the changed files and call sls deploy -s production -f for each one of them.

Sign up to request clarification or add additional context in comments.

Comments

1

I was also faced this issue, and eventually it drove me to create an alternative.

Rocketsam takes advantage of sam local to allow deploying only changed functions instead of the entire microservice. It also supports other cool features such as:

  • Fetching live logs for each function
  • Sharing code between functions
  • Template per function instead of one big template file

Hope it solves your issue :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.