Hi, I want to set up a Prefect agent in AWS ECS. I've set my AWS cred in `~/.aws/config` and did `pr...
s
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
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
You can do it like this and specify the networking
s
Thanks. Can you please share what the
options.yaml
file will look like.
k
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)
I think specifying the cluster keyword in the start command may already fix this though
s
@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
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
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
Hey Blake, I was OOO, will look into this tomorrow. Ping me if I don’t get back to you
j
Hi folks. I’m having the same error. Any further thoughts on this?