Closed
Description
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
# paste logs here