ClusterNotFoundException when using ECSAgent

Hi @Connor_Skennerton, welcome to Prefect Discourse! Glad to have you here! :wave:

I think the problem might be that your ECSRun doesn’t know to which ECS cluster it’s supposed to deploy your flow. Can you try setting the ECS cluster name explicitly like so: run_task_kwargs=dict(cluster="yourECSClusterName")?

Here is usage in a Flow:

import prefect
from prefect import task, Flow
from prefect.run_configs import ECSRun

@task
def hello_task():
    logger = prefect.context.get("logger")
    logger.info("Hello world!")

with Flow("hello-flow", run_config=ECSRun(labels=['test'], 
run_task_kwargs=dict(cluster="yourECSClusterName"),
)) as flow:
    hello_task()