Skip to main content
Service Catalog Version 0.111.7Last updated in version 0.66.0

Amazon ECS Fargate Cluster

View SourceRelease Notes

Overview

This service contains Terraform code to deploy a production-grade ECS cluster for Fargate usage only on AWS using Elastic Container Service (ECS).

This service launches an ECS cluster on top of Fargate that is completely managed by AWS. If you wish to launch an ECS cluster on top of an Auto Scaling Group, refer to the ecs-cluster module. Refer to the section EC2 vs Fargate Launch Types for more information on the differences between the two flavors.

ECS architectureECS architecture

Features

This Terraform Module launches an EC2 Container Service Cluster that you can use to run Docker containers on Fargate and Fargate Spot.

Learn

note

This repo is a part of the Gruntwork Service Catalog, a collection of reusable, battle-tested, production ready infrastructure code. If you’ve never used the Service Catalog before, make sure to read How to use the Gruntwork Service Catalog!

Under the hood, this is all implemented using Terraform modules from the Gruntwork terraform-aws-ecs repo. If you are a subscriber and don’t have access to this repo, email support@gruntwork.io.

Core concepts

To understand core concepts like what is ECS, and the different cluster types, see the documentation in the terraform-aws-ecs repo.

Repo organization

  • modules: the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules.
  • examples: This folder contains working examples of how to use the submodules.
  • test: Automated tests for the modules and examples.

Deploy

Non-production deployment (quick start for learning)

If you just want to try this repo out for experimenting and learning, check out the following resources:

  • examples/for-learning-and-testing folder: The examples/for-learning-and-testing folder contains standalone sample code optimized for learning, experimenting, and testing (but not direct production usage).

Production deployment

If you want to deploy this repo in production, check out the following resources:

Manage

For information on how to manage your ECS cluster, see the documentation in the terraform-aws-ecs repo.

Sample Usage

main.tf

# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S ECS-FARGATE-CLUSTER MODULE
# ------------------------------------------------------------------------------------------------------

module "ecs_fargate_cluster" {

source = "git::git@github.com:gruntwork-io/terraform-aws-service-catalog.git//modules/services/ecs-fargate-cluster?ref=v0.111.7"

# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------

# The name of the ECS cluster
cluster_name = <string>

# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------

# A map of custom tags to apply to the ECS Cluster. The key is the tag name
# and the value is the tag value.
custom_tags = {}

# Whether or not to enable container insights monitoring on the ECS cluster.
enable_container_insights = true

}


Reference

Required

cluster_namestringrequired

The name of the ECS cluster

Optional

custom_tagsmap(string)optional

A map of custom tags to apply to the ECS Cluster. The key is the tag name and the value is the tag value.

{}

Whether or not to enable container insights monitoring on the ECS cluster.

true