Andreas Tsangarides

    Andreas Tsangarides

    11 months ago
    Hi all, has anyone deployed an ECSAgent as a Fargate Service with an application load balancer? Trying to figure out:1. When registering an
    ECSAgent
    we can use
    agent_address=<address:port>
    . Should that be the load balancer's DNS ? 2. What is the health-check command to set in the application balancer?
    Anna Geller

    Anna Geller

    11 months ago
    Hi @Andreas Tsangarides, what capacity provider are you using: EC2 or FARGATE?
    Andreas Tsangarides

    Andreas Tsangarides

    11 months ago
    Hey Anna! FARGATE
    Anna Geller

    Anna Geller

    11 months ago
    In that case, you don’t need an application load balancer. You would need it only if you use EC2 as your ECS data plane because you would have to place containers for your flows on various EC2 instances depending on metrics like CPU load of each instance. With Fargate, all compute for your Prefect flows gets provisioned on demand, so there is nothing to balance over, if that makes sense πŸ™‚ There is an updated guide on how to set up an ECS service for the Prefect agent: https://towardsdatascience.com/how-to-cut-your-aws-ecs-costs-with-fargate-spot-and-prefect-1a1ba5d2e2df
    Andreas Tsangarides

    Andreas Tsangarides

    11 months ago
    Can I not load balance the ECSAgent Fargate service itself to ensure at least one instance is running? That way I can define a security group for the long running instance, too?
    a

    Anna Geller (old account)

    11 months ago
    @Andreas Tsangarides Prefect agent is a lightweight process, so one container is enough, and running your container as ECS service will ensure that even if the agent container dies for some reason, ECS service will restart it.
    Andreas Tsangarides

    Andreas Tsangarides

    11 months ago
    ok good shout! Thanks @Anna Geller
    All works! thanks @Anna Geller fyi, the terraform snippet for running the ECSAgent in
    private
    subnets (i am using a NAT gateway, so do not need to enable the public ip)