AWS CodePipeline, CodeDeploy, SAM and Lambda: how to (inter)connect those?
Asked Answered
S

2

7

I'm a kind of lost in the documentation. I want to push Python code to a repo and use CodePipeline to deploy Lambdas. I have CodeCommit repo, CodePipeline - so far this works and I can create/update CF stack to create supplementary resources.

I know AWS SAM can be used to deploy the functions using CF tpl, but how can I connect SAM with CodePipeline/CodeDeploy? The code should be taken from a 'source' pipeline action then deployed as lambda function.

If SAM isn't the best automated solution here then what should I use instead? Pipeline is the key requirement so we don't have to run something like aws cf update-stack manually, just push the code.

Scalenus answered 1/10, 2018 at 9:19 Comment(0)
E
5

CodePipeline doesn't support deploying Lambda through CodeDeploy, so the approach is to use a CodeBuild Build action to generate an change set from the SAM template and feed it into a CloudFormation Deploy action. You can find a detailed instruction in the following doc.

https://docs.aws.amazon.com/lambda/latest/dg/build-pipeline.html

Eccrine answered 1/10, 2018 at 23:51 Comment(0)
E
1

If you use SAM to deploy Lambdas, CodeDeploy is automatically used. For reference:

Edam answered 22/7, 2019 at 5:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.