Getting started
The Prefect team will provide you with two VPC Endpoint Service names (one for the API, one for the UI). Create a VPC Endpoint in your AWS account for each service you want to use. Provide the following information to Prefect so the connection can be accepted:- AWS Account Number
- VPC ID
- Source Region (for example,
us-east-1) - API VPC Endpoint ID
- UI VPC Endpoint ID (if using the private UI)
Enable Private DNS
Once the connection is accepted, enable Private DNS on each VPC Endpoint. This allows your VPC to resolve the Prefect private endpoints automatically. Without Private DNS enabled, DNS queries forapi.private.prefect.cloud and app.private.prefect.cloud will return NXDOMAIN.
Validate connectivity
Run these commands from within the VPC that has the VPC Endpoints configured. DNS resolution (should return private10.x.x.x IPs):
Configure Prefect clients
SetPREFECT_CLOUD_API_URL and PREFECT_CLOUD_UI_URL to the private endpoints:
PREFECT_CLOUD_UI_URL is inferred automatically from PREFECT_CLOUD_API_URL in most cases, but setting it explicitly ensures that UI links in logs and CLI output point to the private UI endpoint.
Workers and other Prefect clients running inside your VPC will use these endpoints automatically once configured.
Troubleshooting
DNS does not resolve (NXDOMAIN)
Ifnslookup api.private.prefect.cloud or nslookup app.private.prefect.cloud returns NXDOMAIN, Private DNS is not enabled on the VPC Endpoint or the command is being run from outside the VPC. In the AWS console, navigate to VPC > Endpoints, select the endpoint, and confirm Private DNS names enabled is true. If it is not enabled, modify the endpoint to enable it.
VPC Endpoint status is not “Available”
In the AWS console, navigate to VPC > Endpoints and check the Status column. If the status is “Pending”, Prefect has not yet accepted the connection. Contact your Prefect team. If the status is “Rejected” or “Failed”, the endpoint may need to be recreated.Cannot reach the API or UI from within the VPC
- Confirm you are running commands from an instance inside the VPC that has the VPC Endpoints configured.
- Verify the VPC Endpoint’s security group allows outbound HTTPS (port 443) traffic.
- Check that the subnet associated with the VPC Endpoint has a route to the instance you are testing from.
- Run
nslookup api.private.prefect.cloudornslookup app.private.prefect.cloudto confirm DNS resolves.