3 ms·
We use Workers with AWS Lambdas when a container is required. https://github.com/aimoda/cloudflare-worker-to-aws-lambda-function-url-example https://github.com
by Manouchehri 3y ago
We use Workers with AWS Lambdas when a container is required.
https://github.com/aimoda/cloudflare-worker-to-aws-lambda-function-url-example https://github.com/aimoda/cloudflare-worker-to-aws-lambda-fu...
We don't have this in any public example yet, but here's our simple trick with Workers on how to bypass needing to pay for Amazon API Gateway or CloudFront but still get routed to the nearest AWS location:
1. Add add Lambda Function URLs as records in a latency based record on Route 53. (Lambda Function URLs do not support custom domains, so you cannot use this record directly.)
2. Have the Worker do a fetch to `https://cloudflare-dns.com/dns-query https://cloudflare-dns.com/dns-query` on the Route 53 CNAME to discover what lowest latency Lambda Function URL hostname is.
3. The Worker can then fetch the Lambda Function URL using the discovered hostname.