简体   繁体   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"
              }
            ]
          ]
        }
      }
    }
  }
    }
  }
}

I have created a scheduled rule which invokes lambda every one minute.我创建了一个预定规则,它每分钟调用一次 lambda。 I want to add an inputformatter too.我也想添加一个输入格式化程序。 so I added a key called inputformatter but i am facing one issue.所以我添加了一个名为 inputformatter 的键,但我面临一个问题。 In code I have added an inputformatter, now while creating a stack, an error is thrown saying unsupported property inputformatter.在代码中,我添加了一个 inputformatter,现在在创建堆栈时,会抛出一个错误,说不支持的属性 inputformatter。 I have gone throw the documentation as well but not able to find the resolution of the error.我也扔了文档,但找不到错误的解决方案。 Can someone tell me what am i doing wrong here.有人可以告诉我我在这里做错了什么。

This issue was resolved by moving the “input formatter.通过移动“输入格式化程序”解决了这个问题。 “ to targets. “对目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM