Hi,
I am trying to set a CloudWatch Event Rule and specify an Input Transformer in it.
This output will be passed on to a Lambda function.
I need a string output to be passed on to my Lambda function.
However I am not able to find the corresponding Terraform notation to specify the output to be string.
Following is the code snippet:
resource "aws_cloudwatch_event_target" "event_target" {
target_id = "SendToLambda"
arn = "${aws_lambda_function.user_tagger.arn}"
input_transformer = {
input_paths = {
instance="$.detail.responseElements.instancesSet.items[0].instanceId",
user="$.detail.userIdentity.arn"
}
input_template =
"{\"Instance\":<instance>,\"created by user\":<user>}"
}
}
I needed to know the format of input_template to get the output as string.
If the {} are removed getting a syntax error.
Current Output:{"Instance":<instance>,"created by user":<user>}
Expected Output: "Instance <instance> was created by user <user>"
Please help to resolve.
Thanks,
Sayali