https://prefect.io logo
Title
j

Johnny

10/12/2021, 4:20 PM
Hey all, I'm looking at running prefect cloud (managed) and realize in order for my task to access my gcp cloud sql db I would need to whitelist IPs. Does anyone know what are the IPs for prefect cloud?
k

Kevin Kho

10/12/2021, 4:22 PM
Hey @Johnny, I don’t think it’s the IP of Prefect Cloud you need to whitelist. Your agent is in communication with Prefect Cloud, and the agent kicks off a job that does that work. It’s the IP of the machine doing the work that needs to be whitelisted. Does that make sense?
j

Johnny

10/12/2021, 4:26 PM
Are agents not managed by prefect cloud? Or do you have to host and run your own agent? Regardless isn't the task itself hosted by prefect. And as a result the task will need to connect to the db.
k

Kevin Kho

10/12/2021, 4:29 PM
Agents are lightweight process that live on you infrastructure. They poll Prefect Cloud for work to do every 10 seconds. They get the metadata around the job such as where the Flow is stored and how to run it. It then spins up a job to run it. For example, the LocalAgent can be on your computer, and when it picks up a job, it will start a new process on the same machine to run the Flow. So it’s the IP of the LocalAgent machine that needs to be whitelisted since it’s the one doing the work. Prefect doesn’t see your code or data by default
So agents are managed in a sense that we keep track of the health and that we can communicate with it, but it’s on your infrastructure. The task is not hosted by Prefect also. I think Airflow does this where the whole Server is responsible for running your code as well. Prefect is not like that
j

Johnny

10/12/2021, 4:58 PM
^ got it that makes sense... thanks
👍 1
k

Kevin Kho

10/12/2021, 5:00 PM
Of course. Let me know if you have any other questions.