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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则