0

Is there a way to map all parameters,headers and body to the other http endpoint? does it require a special template?

This is what I've got so far:

functions:
  myfunction:
    handler: lambda.myfunction # dummy hanlder
    events:    
      - http:
          path: resource/{resourceId}/other
          method: get
          integration: HTTP
          request:
            uri: http://url/resource/{resourceId}/other
            parameters:
              'method.request.path.resourceId': true
              'method.request.header.my-header': true
          response:
            statusCodes:
              200:
                pattern: ''

Whenever i create directly in the console the the passthrough option is enabled by default and it maps the resourceId correctly.

I tried to look into the documentation but seems that there's almost no documentation on the http integration, unless i'm missing something.

2 Answers 2

1

Is there a way to map all parameters,headers and body to the other http endpoint? does it require a special template?

Yes, use HTTP_PROXY integration type. In the console this is a checkbox in the Integration Request page.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm planning to change this in the future to vpc link, will http-proxy and vpc link pass the authorizer information?
Yes, VPC Link is independent of the integration type so you can choose HTTP_PROXY or HTTP.
0

I was able to find a workaround to have this working, seems more a workaround than the correct solution.

I had to set the Integration.RequestParameters in the resources of the serverless.yml to achieve this.

resources:
  Resources:
   ApiGatewayMethodV1ResourceResourceidVarOtherGet:
    Properties:
      RequestParameters:
        method.request.path.resourceId: true
        method.request.header.my-header: true
      Integration:
        RequestParameters:
          integration.request.path.resourceId: method.request.path.resourceId
          integration.request.header.my-header: method.request.header.my-header

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.