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โ
| Name | Type | Description |
|---|---|---|
| region | string | AWS region to deploy the ECS cluster |
| cluster_name | string | Name to assign to the ECS cluster |
| environment | string | Tag representing the deployment environment |
๐ค Outputsโ
| Name | Description |
|---|---|
| cluster_name | The name of the ECS cluster |
| cluster_arn | The 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.