简体   繁体   English

在 Jenkins 中使用 AWS SAM 部署 AWS Lambda

[英]Deploying AWS Lambda using AWS SAM in Jenkins

Background: In our project we are doing bulk deployment in that we are having around 10 AWS Lambda functions, Few Scala applications and few configuration files.背景:在我们的项目中,我们正在进行批量部署,因为我们有大约 10 个 AWS Lambda 功能、少量 Scala 应用程序和少量配置文件。 Currently we are deploying 10 lambdas if there is no change as well.如果没有变化,目前我们正在部署 10 个 lambda。

Problem: Lets say we have changed code in Scala class, committed to GIT and from there using Jenkins we are deploying the changes.问题:假设我们已经更改了 Scala class 中的代码,致力于 GIT 并从那里使用 Z2E54334C0A35CE2EZE5A58 部署更改。 As we have no differentiation between Lambda and Scala changes we are deploying all the Lambdas, Scala classes and Configuration files as well.由于我们在 Lambda 和 Scala 更改之间没有区别,我们正在部署所有 Lambda、Scala 类和配置文件。

Question: My question here is if we implement SAM on top of our Lambdas and then will separate it out deploying all the lambdas at a time as a separate Jenkins pipeline.问题:我的问题是,如果我们在 Lambda 之上实现 SAM,然后将其分离出来,一次部署所有 lambda,作为单独的 Jenkins 管道。 If there is a change for 1 Python code in Lambda functions will it allow to deploy only delta Lambdas.如果 Lambda 函数中的 1 个 Python 代码发生变化,它将只允许部署 delta Lambda。

sam deploy will only deploy resources if they have changed. sam deploy只会在资源发生变化时部署资源。 Otherwise it noops (no operation).否则它noops(无操作)。

You always have to deploy the entire stack using sam deploy .您始终必须使用sam deploy部署整个堆栈。 If some of your lambdas don't have changes, then --no-fail-on-empty-changeset will be your new friend.如果您的某些 lambda 没有更改,那么--no-fail-on-empty-changeset将成为您的新朋友。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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