aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Use chalice deploy to only update lambda #2018

Open nishant-emburse opened 1 year ago

nishant-emburse commented 1 year ago

Is there a way to use chalice deploy to only update a lambda function?

Currently, I have an existing API Gateway that has several routes defined. Each of these routes point to a different lambda function. E.g.,:

APIGateway X
│
└───/endpoint1 --> Points to lambda1
│   
└───/endpoint2--> Points to lambda2
....
│   
└───/endpoint<n> --> Points to lambda<n>

The creation of resources (APIG and Lambdas) is handled via Terraform and the deployment of lambdas is being handled by a legacy CI system using aws --profile <profile> lambda update-function-code --function-name <name> --zip-file <file> --publish command. Not all of this lambdas live in the same repository and its not possible to house them together at this point. But I want to move away from this system and exploring the possibility of using chalice's deployment capabilities. The problem is I can't change the existing architecture since that's a huge lift.

So essentially I want to only update the lambda code using chalice and not touch any other resources. Is this possible to do? I went over https://github.com/aws/chalice/issues/604 but didn't find a viable solution.

tareshss commented 1 year ago

The only way I have found to do something similar but not exact is to split my project into a microservice setup using Blueprints and multiple chalice projects under one repo. where i only deploy the microservice that i am working on while not needing to deploy other microservice.

For example you can have a one chalice project microservice that handles user accounts (e.g user CRUD operations), which would be different from your business/feature chalice project microservices.