https://prefect.io logo
Title
j

Jonathan Mathews

08/01/2022, 7:38 PM
I’d like to be able to use the
run_task_kwargs_path
for
prefect agent ecs start
as it’s not picking up my VPC (not the default one) but the docs don’t say what format
options.yml
should be in. Saw this issue here, but hasn’t been an update recently https://prefect-community.slack.com/archives/CL09KU1K7/p1653756981241529
1
I’ve also tried using the
--cluster
option but it seems to just ignore that
r

Rob Freedy

08/01/2022, 8:14 PM
Hey Jonathan! You should be able to pass in a yaml file to the cli command using this flag. https://docs-v1.prefect.io/api/latest/cli/agent.html#ecs-start
--run-task-kwargs
j

Jonathan Mathews

08/01/2022, 8:17 PM
Thanks Rob! What should be in that yaml file though?
r

Rob Freedy

08/01/2022, 8:39 PM
That yaml file will be variables that are passed to the ECS run_task function. I would recommend setting the networkConfiguration (in yaml format) section that can be found in the AWS documentation and passing it in through the run-task-kwargs argument. You can also specify the task definition template that the agent can use to spin up new ECS tasks using the
--task-definition
option https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html
j

Jonathan Mathews

08/01/2022, 9:33 PM
Thanks Rob!
👍 1
For anyone coming across this in the future, we had to tweak the case for the keys in the yaml file to get it to work: https://github.com/PrefectHQ/prefect/issues/5379