Select Configure input transformer, and then enter the following text for Input path and Template.
Input path:
{
"instance-id": "$.detail.instance-id",
"state": "$.detail.state",
"time": "$.time",
"region": "$.region",
"account": "$.account"
}
Template:
"At <time>, the status of your EC2 instance <instance-id> on account <account> in the AWS Region <region> has changed to <state>."
Note: For more information about input transformation fields, see Amazon EventBridge input transformation. The input transformer can only use fields that are present in the data event. For example, the following event pattern for an event that the preceding configuration captures shows an instance that entered the Pending state:
{
"id": "7bf73129-1428-4cd3-a780-95db273d1602",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2021-11-11T21:29:54Z",
"region": "us-east-1",
"resources": ["arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"instance-id": "i-1234567890abcdef0",
"state": "pending"
}
}