简体   繁体   中英

Traefik - Redirect Requests to AWS Lambda

How I redirect incoming requests to my AWS Lambda functions?

When sends a request to api.example.com/path send it to path function in AWS Lambda.

Whats must be my traefik.toml file content?

Thanks.

You can't call AWS Lambda functions directly, unless Traefik makes specific code for that case. This is because Lambda functions by default don't have inbound HTTP connections.

However, once you configure AWS API Gateway for the Lambda function, then you have a HTTP endpoint that you can proxy traffic to via Traefik. I recommend you use the API Gateway's Lambda proxy functionality to just pass through the HTTP requests, so you don't have to configure the API Gateway any further.

How to configure your traefik.toml.. https://docs.traefik.io/basics/#modifiers advices using ReplacePath modifier for Lambda use case. It all depends on how you want your URL prefix structure laid out.. say do you want to be able to mount the Lambda API at root (/) or from a subresource downwards..?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM