Hi, I want to set up a Prefect agent in AWS ECS. I've set my AWS cred in
~/.aws/config
and did
prefect auth login
using my API Token. Then I'm running the
prefect agent ecs start
command, expecting an Agent to be created in Fargate and linked to my Cloud, but I'm getting the following error:
Copy code
ERROR - agent | Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs`
Traceback (most recent call last):
...
ValueError: Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs`
What am I doing wrong?
k
Kevin Kho
05/29/2022, 1:12 AM
Hi @Sumant Agnihotri, the agent needs to be connected to the cluster to submit work to. If you have just the default VPC, the agent will be able to infer it. If not, it won’t know which one to connect to. So you need to specify using the
run-task-kwargs
👍 1
Kevin Kho
05/29/2022, 1:13 AM
You can do it like this and specify the networking
s
Sumant Agnihotri
05/29/2022, 4:27 AM
Thanks. Can you please share what the
options.yaml
file will look like.
k
Kevin Kho
05/29/2022, 7:40 PM
I took a look and could not find anything. The closest example I have is the task definition which looks like this , but those are different configs. You want one for
run-task-kwargs
which is a different set of inputs (there is a link to the AWS docs from the Agent docs for that)
Kevin Kho
05/29/2022, 7:42 PM
I think specifying the cluster keyword in the start command may already fix this though
s
Sumant Agnihotri
05/30/2022, 6:38 AM
@Kevin Kho I tried with
cluster
, it didn't work.
As a workaround, I created a Docker that just installs and runs Prefect
local agent
, then I'm running the docker image on Fargate.
k
Kevin Kho
05/30/2022, 4:30 PM
Ah that will work, though of course less ideal. Today is a holiday but ping me tomorrow and I can try to test a working YAML
b
Blake Hamm
06/30/2022, 6:45 PM
Hey @Kevin Kho. I'm having this same issue. I tried with
cluster
as well and I'm getting the same error. I can't find a full example YAML file either. Were you able to create a working one?
k
Kevin Kho
07/05/2022, 2:24 AM
Hey Blake, I was OOO, will look into this tomorrow. Ping me if I don’t get back to you
j
Jonathan Mathews
08/01/2022, 5:33 PM
Hi folks. I’m having the same error. Any further thoughts on this?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.