Skip to main content

ECS Cluster

๐Ÿ“ฆ Overviewโ€‹

This Terraform module provisions a basic Amazon ECS cluster in a specified AWS region. It serves as the foundational control plane for deploying and managing container-based workloads using ECS.


โœ… Key Featuresโ€‹

  • Creates an ECS cluster with a user-defined name
  • Applies tags for environment and ownership clarity
  • Outputs cluster details for integration into service and task modules

๐Ÿ’ผ Use Casesโ€‹

  • Bootstrap a new ECS environment
  • Prepare infrastructure for containerized services
  • Integrate with autoscaling groups and task definitions
  • Use in combination with Level 2 orchestration and deployment modules

๐Ÿ“ฅ Input Variablesโ€‹

NameTypeDescription
regionstringAWS region to deploy the ECS cluster
cluster_namestringName to assign to the ECS cluster
environmentstringTag representing the deployment environment

๐Ÿ“ค Outputsโ€‹

NameDescription
cluster_nameThe name of the ECS cluster
cluster_arnThe Amazon Resource Name (ARN) of the cluster

๐Ÿš€ Deployment Readinessโ€‹

  • โœ… Compatible with Terraform 1.0+
  • โœ… Uses AWS Provider 5.x+
  • ๐Ÿ” Requires ecs:CreateCluster, ecs:TagResource, and related IAM permissions

๐Ÿ› ๏ธ Example Usageโ€‹

module "ecs_cluster_deployment" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//container/ecs-cluster?ref=v1.0.0"

region = "us-east-1"
cluster_name = "archiphire-cluster"
environment = "prod"
}
terraform init
terraform plan
terraform apply

or

tofu init
tofu plan
tofu apply

๐Ÿงน Cleanupโ€‹

Terraform Destroy (Isolated Use):

terraform destroy

or

tofu destroy

Manual Deletion (Recommended for Production):

aws ecs delete-cluster --cluster archiphire-cluster

๐Ÿ›ก๏ธ Notesโ€‹

This is a Level 1 container module.
Use it as the backbone for running ECS services, task definitions, and service discovery integrations.
For complete orchestration, pair with networking, IAM, and autoscaling modules.


๐Ÿ”’ Deployment Package Noticeโ€‹

This module is part of the Level 1 AWS License Tier.
To access the full deployment package and source code, subscribe to Archiphire.