包装 AWS SAM 应用
现在,SAM-Tutorial
目录下应当具备四个文件:
-
beforeAllowTraffic.js
-
afterAllowTraffic.js
-
myDateTimeFunction.js
-
template.yml
现在您已准备好使用 AWS SAM sam package 为您的 Lambda 功能和 CodeDeploy 应用。构件将被上传到 S3 存储桶。命令的输出是一个名为 package.yml
...此文件用于 AWS SAM sam
deploy 命令。
TheThethe sam package 命令是 aws cloudformation package AWS CLI 命令。有关详细信息,请参阅 套餐 在 AWS CloudFormation CLI参考.
在 SAM-Tutorial
目录中,运行以下命令。
sam package \ --template-file template.yml \ --output-template-file package.yml \ --s3-bucket
your-S3-bucket
对于 s3-bucket
参数,指定 Amazon S3 您已创建为本教程的先决条件。TheThethe output-template-file
指定新文件的名称 AWS SAM sam deploy 命令。