title: AWS CloudFormation: AWS::Events::Rule - InputTemplate
body: <p>I'm building a AWS CloudFormation file, and I'm stuck in the <code>AWS::Events::Rule</code> service. I'm trying to make a rule that will send out an email to developers for every stage of a CodePipeline. This is the whole file:</p>
  
  <pre><code>{
      "PipelineWebpageAccessStageNotification": {
          "Type": "AWS::Events::Rule",
          "Properties": {
              "Description": "Send out notifications to developers about the CodePipeline stages status for the websites.",
              "Name": "codepipeline-webpage_access",
              "RoleArn": { "Fn::GetAtt": ["PipelineWebpageAccessStageNotificationRole", "Arn" ] },
              "EventPattern": {
                  "source": [
                      "aws.codepipeline"
                  ],
                  "detail-type": [
                      "CodePipeline Stage Execution State Change"
                  ],
                  "detail": {
                      "pipeline": [
                          { "Ref": "PipelineWebpageAccess" }
                      ],
                      "state": [
                          "FAILED",
                          "CANCELED",
                          "RESUMED",
                          "SUCCEEDED",
                          "STARTED"
                      ]
                  }
              },
              "State": "ENABLED",
              "Targets": [
                  {
                      "Arn": { "Ref": "SNSTopic" },
                      "Id": "SNS",
                      "InputTransformer": {
                          "InputPathsMap": {
                              "pipeline": "$.detail.pipeline",
                              "stage": "$.detail.stage",
                              "state": "$.detail.state"
                          },
                          "InputTemplate": "Hello Human, This message is related to the CodePipeline: &lt;pipeline&gt;. Bellow are some details: \r\n\r\n - Stage: &lt;stage&gt;\r\n - Status: &lt;state&gt;\r\n\r\n Thank you for reading, Enjoy your existence."
                      }
                  }
              ]
          }
      }
  }
  </code></pre>
  
  <p>The issue is with <code>InputTemplate</code>. CloudFormation tells me to send a String. Which I'm doing... Turns out that you actually have to send a string containing JSON. OK, so I did that as I did in other other places, for example you pass a string with JSON when you build a dashboard in CloudWatch. That works without a problem. But here - it keeps failing. </p>
  
  <p>The interesting thing, is that the same issue happens in the AWS Dashboard.</p>
  
  <p>I did talk with AWS Tach Support, and they also have no idea how to solve this, they did provided some approaches to try, but none worked. </p>
  
  <p>They told me they are going to ask the team that is responsible for this part of AWS, but I don't have high hopes.</p>
  
  <h1>Question</h1>
  
  <p>If you had the same problem and some how figure it out, we'd be grateful for the solution :)</p>