[英]SAM/Serverless/CodeBuild clarification
I am hoping for some clarification around some terms I have been seeing on the web as it pertains to AWS and specifically lambdas.我希望对我在 web 上看到的一些术语进行一些澄清,因为它与 AWS 尤其是 lambdas 相关。 For starters, I would like the know how the commands
sam build/deploy
work versus setting up a CodeBuild job.对于初学者,我想知道命令
sam build/deploy
与设置 CodeBuild 作业是如何工作的。 Do I need a CodeBuild job to run those commands?我是否需要 CodeBuild 作业来运行这些命令? What files specifically does the
sam deploy
command look for? sam deploy
命令具体查找哪些文件? Does it look for serverless.yml
or template.yml
or both?它会寻找
serverless.yml
或template.yml
还是两者兼而有之? What is a sam.yml
file or are they antiquated?什么是
sam.yml
文件或者它们已经过时了?
I have an app with a CodeBuild pipeline for a lambda, but I am expanding my repo to contain multiple lambdas and thinking about putting a serverless.yml
file in each lambda directory, but I don't want to create a CodeBuild job and buildspec
for each one.我有一个带有用于 lambda 的 CodeBuild 管道的应用程序,但我正在扩展我的存储库以包含多个 lambda,并考虑在每个
buildspec
目录中放置一个serverless.yml
文件,但我不想为每一个。 I assume sam deploy
searches for all template.yml
and serverless.yml
files and constructs your stack as a whole (and updates only what needs to be updated?)我假设
sam deploy
搜索所有template.yml
和serverless.yml
文件并将您的堆栈作为一个整体构建(并且只更新需要更新的内容?)
App is in Node if curious using API Gateway.如果对使用 API 网关感到好奇,应用程序在 Node 中。 Any insight would be appreciated.
任何见解将不胜感激。
I will try to give brief answers:我将尝试给出简短的答案:
sam deploy
do : It will zip the code and create cloudformation yaml file into .aws-sam
folder and run cloudformation deploy. sam deploy
的作用:它将 zip 代码并在.aws-sam
文件夹中创建 cloudformation yaml 文件并运行 cloudformation deploy。sam deploy
always looks for template.yaml
By default yes, but can be easily overridden by passing --template-file sam deploy --template-file template-x.yml
sam deploy
是否总是查找template.yaml
默认是,但可以通过传递 --template-file sam deploy --template-file template-x.yml
轻松覆盖
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.