API Gateway Integration: BadRequestException: Invalid mapping expression specified Terraform SNS integration

0

What is wrong with this particular piece of terraform and why I am getting an error.

resource "aws_apigatewayv2_integration" "place_order" {
  api_id              = aws_apigatewayv2_api.gateway.id
  credentials_arn     = aws_iam_role.gateway_role.arn
  integration_type    = "AWS_PROXY"
  integration_subtype = "StepFunctions-StartSyncExecution"


  request_parameters = {
    StateMachineArn = aws_sfn_state_machine.process_order.arn
    Input           = jsonencode({
      body = "$request.body"
    })
  }

  lifecycle {
    create_before_destroy = true
  }
}

According to https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html $request.body should "API Gateway passes the entire request body through."

But I am getting an error:

Error: updating API Gateway v2 integration: BadRequestException: Invalid selection expression specified: Validation Result: warnings : [], errors : [Invalid source: {"body":"$request.body"} specified for destination: Input]
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions