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]
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen