【发布时间】:2021-12-17 10:58:37
【问题描述】:
我创建了一个 SAM 项目并创建了一个简单的 hello world lambda。执行后:
sam 包 --template-file template.yaml --output-template-file output.yaml --s3-bucket bucket-child-s3
成功上传到S3,执行时出现问题:
let params = {
StackName: 'stack-child',
Capabilities: ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
TemplateURL: 'https://s3.amazonaws.com/bucket-child-s3/9f63c6d47e7b8dde84306e20197e557b'
};
const result = await cloudformation.createStack(params).promise();
我收到此错误:
模板的大小不得超过 1000000 字节
我查看了我的 s3 存储桶,文件大小为 28.7 MB,我不知道为什么当我只上传一个带有 hello world 消息响应的 lambda 时会这么大。
我需要做些什么来最小化文件大小?
【问题讨论】:
标签: amazon-web-services amazon-s3 aws-lambda amazon-cloudformation aws-sam