Hi! I work at a last-mile delivery company built o...
# introductions
c
Hi! I work at a last-mile delivery company built on the gig model. Our data team just made the decision to start using prefect. I’ve been given the task of spinning the infrastructure. I’ve been running through the ECS docs but can’t get the container to actually start. Looking for where to get help with this.
👋 15
d
Welcome, @Carl Allen! 👋
#CL09KU1K7 is the best channel for asking help questions 😄
g
Welcome Carl! If you'd like some formal support from our CS team feel free to message @Anthony Head directly!
k
Hi @Carl Allen, welcome to Prefect!
a
Hi @Carl Allen, welcome to Prefect! 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. But if you have any questions about that, you can reach out and post it in the community channel.
c
@Anna Geller yeah, I did pretty much all those things (except I did it in terraform) and the container won’t start.
Copy code
ValueError: Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs``
k
How do you spin up the agent? Maybe you can add your network configuration there?
a
@Carl Allen when you create your ECS service for the agent and you use awsvpc as network mode, then you need to provide network configuration so that AWS knows to which VPC and subnets to deploy this service. You can use the
--network-configuration
option in the command below - this is the configuration that seems to be missing in your Terraform script:
Copy code
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
c
nope, that’s all there:
Copy code
network_configuration {
    subnets          = data.aws_subnet_ids.vpc_subnet_ids.ids
    security_groups  = [aws_security_group.prefect.id]
    assign_public_ip = true
  }
a
Can you share your entire terraform script for that (without sensitive info) in #CL09KU1K7? perhaps someone from the community knows terraform more to figure it out.