/terraform-aws-ecs

Terraform module which creates AWS ECS resources

Primary LanguageHCL

AWS Elastic Container Service (ECS) Terraform module

Terraform module which creates ECS resources on AWS.

This module focuses purely on ECS and nothing else. Therefore only these resources can be created with this module:

However, having said the above to have a proper ECS cluster up and running multiple resources are needed. In most cases creating these resources is heavily opinionated and or context-bound. That is why this module does not create these resources. But you still need them to have a production ready environment. Therefore the example area shows how to create everything needed for a production environment.

Terraform versions

Terraform 0.12. Pin module version to ~> v2.0. Submit pull-requests to master branch.

Terraform 0.11. Pin module version to ~> v1.0. Submit pull-requests to terraform011 branch.

Usage

module "ecs" {
  source = "terraform-aws-modules/ecs/aws"

  name = "my-ecs"
}

Conditional creation

Sometimes you need to have a way to create ECS resources conditionally but Terraform does not allow to use count inside module block, so the solution is to specify argument create_ecs.

# ECS cluster will not be created
module "ecs" {
  source  = "terraform-aws-modules/ecs/aws"
  version = "~> 2.0"

  create_ecs = false
  # ... omitted
}

Examples

Inputs

Name Description Type Default Required
create_ecs Controls if ECS should be created string "true" no
name Name to be used on all the resources as identifier, also the name of the ECS cluster string n/a yes
tags A map of tags to add to ECS Cluster map <map> no

Outputs

Name Description
this_ecs_cluster_arn
this_ecs_cluster_id
this_ecs_cluster_name The name of the ECS cluster

Authors

Module managed by Armin Coralic, Anton Babenko and other awesome contributors.

License

Apache 2 Licensed. See LICENSE for full details.