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]
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南