Skip to content

What is the proper decoration for a {proxy+} #700

Closed
@gwlester

Description

@gwlester

What were you trying to accomplish?
We want to have a function handle proxying to an ELB.

  MicroServices:
    Type: AWS::Serverless::Function
    Properties:
      Handler: 'microServices.api_call_dispatcher'
      FunctionName: !Sub "micro-services"
      CodeUri: ../../src/microServices/
      Description: Implements calls to all of the micro servcies
      Runtime: python3.8
      Timeout: 60
      Layers:
        - !GetAtt rAwsLambdaPowertoolsPythonLayer.Outputs.LayerVersionArn
      Events:
        OnPremiseApiEvent:
          Type: Api
          Properties:
            Path: /proxy/{proxy+}
            Method: Any
            RestApiId:
              Ref: rApiGateway
from aws_lambda_powertools.event_handler.api_gateway import ApiGatewayResolver

app = ApiGatewayResolver()

@app.get("/proxy/<proxy>")
def proxy(proxy):
    try:
        return on_premise_api_handler(app, proxy)  #

def lambda_handler(event, context):
    return app.resolve(event, context)

Expected Behavior

Documentation containing the correct decoration for a proxy handler.

Current Behavior

No documentation containing the correct decoration for a proxy handler.

Possible Solution

Steps to Reproduce (for bugs)

Environment

  • Powertools version used: 1.20.2
  • Packaging format (Layers, PyPi): Layer
  • AWS Lambda function runtime: 3.8
  • Debugging logs

How to enable debug mode**

# paste logs here

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationp1

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions