Reputation: 2146
I have an AWS Lambda that was created by a Cloudformation template. Over the last couple of days I enhanced the function code. Now I would like to update the original function template with the updated Lambda code.
What's the best way to achieve this?
I'd like to avoid having to manually convert the Lambda python code to yaml or json as this will be too time consuming and error prone, anticipating that there will be fixes to the code over the next few weeks.
Upvotes: 1
Views: 793
Reputation: 399
One way to achieve this is using SAM https://aws.amazon.com/serverless/sam/.
This way you will always be able to package your lambdas in your cloudformation template before it's deployed.
CDK will also achieve this concept.
If this is only a one time thing you want to do, you don't really need to change anything in that lambda, you would just copy the code and paste it in your CloudFormation template as an inline code as so: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html
Upvotes: 2