【发布时间】:2021-09-14 05:48:20
【问题描述】:
我有一个 template.yml,我试图在其中定义这个资源:
HelloFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: handler.hello
Runtime: nodejs12.x
InlineCode:
ZipFile: |
exports.handler = async (event) => {
const response = {
statusCode: 200,
body: JSON.stringify('Hello from Lambda function!'),
};
return response;
};
Events:
HelloAPI:
Type: HttpApi
Properties:
ApiId: !Ref SpikeApi
Path: /hello
Method: GET
在此之前的资源创建没有问题,但在这里我得到这个错误:
Properties validation failed for resource HelloFunction with message: #/Code/ZipFile: expected type: String, found: JSONObject
【问题讨论】:
标签: amazon-web-services aws-lambda yaml amazon-cloudformation