Hi all. I am trying to setup ECS agent to run flows in Fargate. Assuming that I have an ECS Fargate cluster ready, here is how I start my agent
from prefect.agent.ecs import ECSAgent
agent = ECSAgent(
name='Test Agent',
region_name='eu-west-1',
cluster='my-test-cluster',
launch_type='FARGATE',
run_task_kwargs_path='./config.yaml'
)
agent.start()
This then failed with the following message
[2021-05-14 12:46:54,069] ERROR - Test Agent | Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs`
Traceback (most recent call last):
File "/Users/kha/Desktop/foo/agent.py", line 3, in <module>
agent = ECSAgent(
File "/opt/homebrew/Caskroom/miniforge/base/envs/zoined/lib/python3.9/site-packages/prefect/agent/ecs/agent.py", line 234, in __init__
] = self.infer_network_configuration()
File "/opt/homebrew/Caskroom/miniforge/base/envs/zoined/lib/python3.9/site-packages/prefect/agent/ecs/agent.py", line 274, in infer_network_configuration
raise ValueError(msg)
ValueError: Failed to infer default networkConfiguration, please explicitly configure using `--run-task-kwargs`