简体   繁体   中英

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

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM