DC
DC
CDCloudflare Developers
Created by DC on 12/2/2024 in #general-help
VPC equivalent on cloudflare
Hi all, I am exploring using cloudflare as an alternative to AWS API gateway and lambda. The proposed architecture is something like this: We would create a VPC - at the edge of the net there would be an API gateway. This checked authorisation and if permitted passes it on to the specific handler. In cloudflare, I am thinking that we would have a worker that acts as the gateway. This checks access and if permitted calls the associated sub-worker. This is where I have come a little unstuck - there does not seem to be concept, that I can see, of VPC in cloud flare - so I am wondering how to approach this. Adding the gateway seems trivial , however, I am not sure how I go about a) addressing the sub-workers; b) making those sub workers accessible only to the gateway. It feels like a common pattern and one that would have been repeated many times, but so far after many hours of googlling I am drawing blank. I am wondering if zero trust is the key here - but I am not sure quite how i would use it in this context. Any advise / pointers to guides would be much appreciate
4 replies
CDCloudflare Developers
Created by DC on 11/6/2023 in #workers-help
Is it possible to have no routes associated to a worker?
I have a worker that will act as a consumer for a queue. It will also have a cron function. As such it does not need a route. I have removed the route from the dashboard, but it gets re-added on deployment. Does anyone know, is there a setting in the wrangler file to tell CF not to generate an active route? Many thanks...
4 replies
CDCloudflare Developers
Created by DC on 11/1/2023 in #workers-help
multiple producers
Hello everyone. I am trying to build a worker which takes in requests via an API and the pushes to a queue of a dedicated worker. According to the documents, a worker can be the producer for many queues. However, I am not able to get it to bind. I cannot see an exact example so have copied the example for multiple KV stores. queues.producers = [ {queue = "xyz-process-queue", binding = "WORKER_QUEUE"}, {queue = "xyz-log-queue", binding = "QUEUE_LOG"}, ] The toml file seems to be happy and deploys, although the cloudflare dashboard does not recognize the QUEUE_LOG as having a producer. In the code, I have: export interface Env { WORKER_QUEUE: Queue; QUEUE_LOG: Queue; } Does anyone have any thoughts on what I might be missing here? If I console.log env.QUEUE_LOG it is null. I am grateful for any thoughts.... DC
8 replies