Sandip Viradiya
12/03/2021, 5:47 AMECSAgent(
cluster="NAME OF THE CLUSTER",
task_role_arn="ROLE ARN"
)
Above code is working perfectly for one Prefect account but giving below error for another account. Can anyone please guide me what I am missing?
ValueError: Failed to infer default networkConfiguration, please explicitly configure using
--run-task-kwargs``
I did not required any configuration for first account for networkConfiguration.
I am using Prefect 0.15.9.Anna Geller
--network-configuration
option in the command below - this is the configuration that seems to be missing in your agent startup command:
aws ecs create-service \
--service-name $ECS_SERVICE_NAME\
--task-definition $ECS_SERVICE_NAME:1 \
--desired-count 1 \
--launch-type FARGATE \
--platform-version LATEST \
--cluster $ECS_CLUSTER_NAME \
--network-configuration awsvpcConfiguration="{subnets=[$SUBNET1, $SUBNET2, $SUBNET3],assignPublicIp=ENABLED}" --region $AWS_REGION
The one account for which it worked, has most likely taken the default VPC, but defining it explicitly is better to avoid surprises such as this one.
We’ve recently updated the docs for the ECS Agent and the ECSRun, incl. examples in the docstring. There is also this blog post explaining how to set up an ECS service for the agent to ensure your agent is running reliably 24/7.Sandip Viradiya
12/08/2021, 5:42 AM