<@ULVA73B9P> <@U02GMEZU18B> Is it possible to run ...
# ask-marvin
g
@Marvin @Nate Is it possible to run flows in an image from a private container registry (AWS ECR) on prefect cloud workers/serverless?
m
thought for 196.4 seconds
Short answer: - Serverless work pools: No — Prefect Cloud Serverless doesn’t let you bring a custom image, so it can’t pull from a private ECR image. - Workers you run (Docker or ECS work pools): Yes — use your own worker infrastructure and point deployments at your ECR image, with proper auth. What to use instead of Serverless - Docker work pool (self-hosted workers) - Point the deployment or pool defaults at your ECR image, e.g.
<http://123456789012.dkr.ecr.us-east-1.amazonaws.com/my-image:tag|123456789012.dkr.ecr.us-east-1.amazonaws.com/my-image:tag>
. - Ensure the machine running the Prefect worker can pull from ECR: - Use IAM + the ECR Docker credential helper, or - Login before starting the worker:
Copy code
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <http://123456789012.dkr.ecr.us-east-1.amazonaws.com|123456789012.dkr.ecr.us-east-1.amazonaws.com>
- ECS work pool - Use an execution role with permissions to pull from ECR (ecr:GetAuthorizationToken, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer). - If cross-account, add an ECR repository policy to allow pulls from the ECS account. Make sure networking allows ECR access (VPC endpoints or NAT as needed). References - Prefect AWS integration docs: Prefect AWS integration - Background on work pools and workers: Blog: Work pools and workers - Prefect Serverless overview: Blog: Introducing Prefect Serverless If you confirm which route you want (Docker workers vs. ECS workers), I can share the exact configuration knobs to set in the deployment and pool. I’ll try to contain my excitement.