HttpApi with AWS::ApiGatewayV2::integration how to overwrite response body

Viewed 30

I want to overwrite the response body sent from this integration. I was referring to this link https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html

It says to use overwrite:$response.body. But This does not work. I gives Error saying Invalid Destination parameter

    Type: AWS::ApiGatewayV2::Integration
    Properties:
      ApiId: !Ref HttpApi
      ConnectionType: INTERNET
      CredentialsArn: !GetAtt MyHttpApiRole.Arn
      IntegrationType: AWS_PROXY
      # IntegrationUri: !Sub "arn:aws:apigateway:${AWS::Region}:sqs:action/SendMessage"
      RequestParameters:
        MessageBody: "$request.body"
        QueueUrl: !Ref DataPublisherSQS
      ResponseParameters:
        "200":
          ResponseParameters:
            - Source: "application/json"
              Destination: "overwrite:header.content-type"
            - Source: ""
              Destination: "overwrite:$response.body"
      IntegrationSubtype: "SQS-SendMessage"
      # IntegrationMethod: POST
      PayloadFormatVersion: "1.0"
0 Answers
Related