【问题标题】:Cloudformation YAML: expected type String, found JSONObjectCloudformation YAML:预期类型字符串,找到 JSONObject
【发布时间】: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


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2021-01-16
      • 1970-01-01
      • 2013-09-22
      • 2021-12-05
      • 2012-06-08
      • 2017-03-17
      • 2018-04-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多