Hi Beautiful People!
I love Cloudflare Workers, and I would love a way to ensure our Cloudflare Workers have access to our AWS Load Balancer, by adding all Cloudflare Worker IP addresses to our Load Balancer security group.
I added all the IP addresses listed here to our security group and the Load Balancer rejected the request.
So I added this code to our Cloudflare Worker to determine the Workers IP address
await fetch('https://www.cloudflare.com/cdn-cgi/trace') .then(response => response.text()) .then(trace => console.log('trace', trace))
Then I put the IP address that was identified from the code above into the Load Balancer security group and the request worked!
So my questions are
- Is there a list of Cloudflare Workers IP Addresses available please?
- Is there a best practice to ensure only our Cloudflare Worker may access our Load Balancer please? Maybe some kind of header identifier?!
Thank you friends!