【发布时间】:2020-05-02 18:07:10
【问题描述】:
如果这是无效的 CloudFormation 模板,那么应该有人告诉写这篇博文的工程师:Managing Lambda@Edge and CloudFront deployments by using a CI/CD pipeline | Networking & Content Delivery
我正在使用该模板成功部署。
但我想使用变更集进行更安全的部署。
当我尝试创建更改集时,CloudFormation 告诉我缺少 CodeUri:
转换 AWS::Serverless-2016-10-31 失败,原因是:无服务器应用程序规范文档无效。发现的错误数:1. id 为 [LambdaEdgeFunctionSample] 的资源无效。必须设置“InlineCode”或“CodeUri”
此模板部署没有问题。
此外,我认为我不能为此使用 sam 命令 (A simpler deployment experience with AWS SAM CLI | AWS Compute Blog),因为 lambda 函数只是此 CloudFormation 模板的一小部分。
当尝试不同的 CodeURI 时,我可以看到它需要一个 s3 URL:
Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyFunction] is invalid. 'CodeUri' is not a valid S3 Uri of the form \"s3://bucket/key\" with optional versionId query parameter.
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-cloudformation aws-sam