hey all, has anyone used the terraform ecs recipes...
# ask-community
t
hey all, has anyone used the terraform ecs recipes from the prefect repo? https://github.com/PrefectHQ/prefect-recipes/tree/main/devops/infrastructure-as-code/aws I setup a prefect2 csg agent/worker and now I'm getting an error about subnets when trying to launch flows from a deployment. anyone hit this error before?
Copy code
botocore.errorfactory.InvalidParameterException: An error occurred (InvalidParameterException) when calling the RunTask operation: subnets can have at most 16 items.
e
Huh, that’s interesting! Sounds like ECS won’t let you pass more than 16 subnets… are you explicitly passing subnets, and if so, how many?
Which recipe are you using by the way?
t
I was using both the ecs agent and worker recipe. I believe the issue is coming from the agent but I'm only passing in one subjnet. here's an example of what my agent looks like
Copy code
module "prefect2_ecs_agent" {
  source = "<http://github.com/PrefectHQ/prefect-recipes//devops/infrastructure-as-code/aws/tf-prefect2-ecs-agent?ref=fc8d8568426408bce4aaea0492a3fee7e2a6e874|github.com/PrefectHQ/prefect-recipes//devops/infrastructure-as-code/aws/tf-prefect2-ecs-agent?ref=fc8d8568426408bce4aaea0492a3fee7e2a6e874>"

  agent_subnets = [
    "subnet-BBB",
  ]
  name                 = "prefect2-agent"
  prefect_account_id   = "XXX"
  prefect_api_key      = "YYY"
  prefect_workspace_id = "ZZZ"
  vpc_id               = "vpc-AAA"
}