簡體   English   中英

CloudFormation AWS::Events::Rule:遇到不支持的屬性輸入格式化程序

[英]CloudFormation AWS::Events::Rule: Encountered unsupported property inputformatter

{
  "Parameters": {
    "LambdaFunction": {
      "Type": "String"
    }
  },
  "Resources": {
    "ScheduledRule": {
      "Type": "AWS::Events::Rule",
      "Properties": {
        "Description": "ScheduledRule",
        "ScheduleExpression": "rate(1 minutes)",
        "State": "ENABLED",
         "InputTransformer": {
          "InputPathsMap": {
            "details": "$.detail"
          },
          "InputTemplate":"{\r\n            \"body\": \"<details>\",\r\n            \"resource\": \"\/{proxy+}\",\r\n            \"requestContext\": {\r\n              \"resourcePath\": \"\/{proxy+}\",\r\n              \"httpMethod\": \"POST\",\r\n              \"identity\": {},\r\n              \"path\": \"\/eventPolling\",\r\n              \"protocol\": \"HTTP\/1.1\",\r\n              \"requestTimeEpoch\": 0\r\n            },\r\n            \"queryStringParameters\": {},\r\n            \"headers\": {\r\n              \"Authorization\": \"Basic SURNUUFQQTpUSDRiSko4ZUZCY0pfXzY0eXZkR29n\",\r\n              \"Content-Type\": \"application\/json\"\r\n            },\r\n            \"pathParameters\": {},\r\n            \"httpMethod\": \"POST\",\r\n            \"path\": \"\/eventPolling\",\r\n            \"isBase64Encoded\": false\r\n          }"
        },
        "Targets": [
          {
            "Arn": {
              "Fn::Join": [
                ":",
                [
                  "arn",
                  {
                    "Ref": "AWS::Partition"
                  },
                  "lambda",
                  {
                    "Ref": "AWS::Region"
                  },
                  {
                    "Ref": "AWS::AccountId"
                  },
                  "function",
                  {
                    "Ref": "LambdaFunction"
                  }
                ]
              ]
            },
            "Id": "TargetFunctionV1"
          }
        ]
      },
      "Metadata": {
        "AWS::CloudFormation::Designer": {
          "id": "4950b64c-3bb1-4876-9697-a15d16803a89"
        }
      }
    },
    "PermissionForEventsToInvokeLambda": {
      "Type": "AWS::Lambda::Permission",
      "Properties": {
        "FunctionName": {
          "Ref": "LambdaFunction"
        },
        "Action": "lambda:InvokeFunction",
        "Principal": "events.amazonaws.com",
        "SourceArn": {
          "Fn::Join": [
            ":",
            [
              "arn",
              {
                "Ref": "AWS::Partition"
              },
              "lambda",
              {
                "Ref": "AWS::Region"
              },
              {
                "Ref": "AWS::AccountId"
              },
              "function",
              {
                "Ref": "LambdaFunction"
              }
            ]
          ]
        }
      }
    }
  }
    }
  }
}

我創建了一個預定規則,它每分鍾調用一次 lambda。 我也想添加一個輸入格式化程序。 所以我添加了一個名為 inputformatter 的鍵,但我面臨一個問題。 在代碼中,我添加了一個 inputformatter,現在在創建堆棧時,會拋出一個錯誤,說不支持的屬性 inputformatter。 我也扔了文檔,但找不到錯誤的解決方案。 有人可以告訴我我在這里做錯了什么。

通過移動“輸入格式化程序”解決了這個問題。 “對目標。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM