Skip to main content
Knowledge Base

Fargate example for ecs-service from Service Catalog?

Answer

We are using the `ecs-service` module in the Service Catalog, and would like to know how to configure it with Fargate. Is there a production example we can use for this? --- <ins datetime="2022-08-24T14:46:35Z"> <p><a href="https://support.gruntwork.io/hc/requests/109164">Tracked in ticket #109164</a></p> </ins>

We currently don't have a for production example for how to setup `ecs-service` with Fargate, but [the ecs-service example](https://github.com/gruntwork-io/terraform-aws-service-catalog/blob/v0.96.2/examples/for-learning-and-testing/services/ecs-service/main.tf) contains support for enabling Fargate with the underlying module. If you trace the Terraform code for when the `var.launch_type` variable is set to `FARGATE`, you will see what needs to be set. For your convenience, here are the things that are necessary: - The `launch_type` input must be set to `FARGATE`. - The `task_cpu` and `task_memory` inputs must be set. - The `network_mode` must be set to `awsvpc`, and a `network_configuration` must be provided to bind the proper subnets and security group rules to the ECS Tasks.