Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services sam打包和部署,无需打包参数文件_Amazon Web Services_Amazon S3_Amazon Cloudformation_Aws Sam_Aws Sam Cli - Fatal编程技术网

Amazon web services sam打包和部署,无需打包参数文件

Amazon web services sam打包和部署,无需打包参数文件,amazon-web-services,amazon-s3,amazon-cloudformation,aws-sam,aws-sam-cli,Amazon Web Services,Amazon S3,Amazon Cloudformation,Aws Sam,Aws Sam Cli,我们的sam包命令是- sam package --template-file template.YML --output-template-file packaged-service.yml --s3-bucket $Template_Bucket_Name --s3-prefix service-build-$packagenumber sam deploy packaged-service.yml --stack-name service --capabilities CAPABILIT

我们的sam包命令是-

sam package --template-file template.YML --output-template-file packaged-service.yml --s3-bucket $Template_Bucket_Name --s3-prefix service-build-$packagenumber
sam deploy packaged-service.yml --stack-name service --capabilities CAPABILITY_NAMED_IAM --region us-east-1 --s3-bucket $Template_Bucket_Name --s3-prefix service-deploy-$packagenumber --template-file template.YML --parameter-overrides  "ParameterKey=EnvType,ParameterValue=ftest" --no-fail-on-empty-changeset
sam部署命令是-

sam package --template-file template.YML --output-template-file packaged-service.yml --s3-bucket $Template_Bucket_Name --s3-prefix service-build-$packagenumber
sam deploy packaged-service.yml --stack-name service --capabilities CAPABILITY_NAMED_IAM --region us-east-1 --s3-bucket $Template_Bucket_Name --s3-prefix service-deploy-$packagenumber --template-file template.YML --parameter-overrides  "ParameterKey=EnvType,ParameterValue=ftest" --no-fail-on-empty-changeset
package-service.yml文件的意义是什么?我可以在没有它的情况下运行deploy。那么它实现了什么目的呢?官方软件包和部署页面对此并不清楚。 packaged-service.yml有一个指向s3 bucket的codeuri字段。在上面的示例中,该文件可能没有任何用处?
如何在aws sam部署命令期间使用元数据选项?

如果您使用的是最新版本的sam CLI

在SAM的早期版本中,如果lambda函数需要将依赖项打包到存档中,则需要执行
打包
步骤。如果Lambda是单个python文件,那么您就可以直接进入
deploy
。 由于大多数SAM项目更为复杂,
通过将项目打包到存档中、将工件上载到S3,然后重新编写SAM yaml以引用工件上载的新S3位置来提供帮助

我认为AWS团队最终发现这个包步骤有点多余,并且几乎总是在部署之前执行,这使得过程更加简单

仍然包含
命令,以实现向后兼容性,并在某些团队仍然需要多阶段构建和部署过程时提供更大的灵活性