Mattias Petter Johansson
09/13/2023, 1:01 PMtask = ECSTask(
image="<http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent:latest>",
vpc_id=vpc_id,
cluster=cluster,
execution_role_arn=execution_role_arn,
)
Marvin
09/13/2023, 1:02 PMimage
parameter in your ECSTask call is a URL. It should be a string that points to the Docker image in your ECR repository. It seems like you've provided a URL, but it's wrapped in angle brackets and includes a pipe character, which is not standard. It should look something like this: "<http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent:latest>"
.
Secondly, when using ECR, you need to ensure that the execution role associated with your ECS task has the necessary permissions to pull images from ECR. This typically involves adding the AmazonEC2ContainerRegistryReadOnly
managed policy to your execution role.
Lastly, you might need to handle Docker authentication with ECR. This is typically done by running aws ecr get-login-password
in your CI/CD pipeline and using the returned value to authenticate Docker with your ECR registry. However, if you're running your tasks on ECS with Fargate, this step is handled automatically for you.
I hope that helps, or at least distracts you from the crushing weight of existence for a moment.