Auto-generated
This page is generated by terraform-docs at build time from the infra/ repo. Do not edit manually.
Edge ECS Cluster¶
EC2-backed ECS cluster for Edge API. Includes the ECS cluster, Auto Scaling Group with launch template, IAM roles for task execution and EC2 instances, and Container Insights monitoring.
The ASG is attached to the cluster as a capacity provider with managed draining only (IS-81): when the ASG terminates a node (instance refresh, scale-in, rebalancing), ECS drains it and the service places replacement tasks before the node goes. Managed scaling and termination protection are off; the ASG size is set here, not by ECS.
Requirements¶
No requirements.
Providers¶
| Name | Version |
|---|---|
| aws | n/a |
Modules¶
No modules.
Resources¶
| Name | Type |
|---|---|
| aws_autoscaling_group.edge_ecs | resource |
| aws_ecs_capacity_provider.edge | resource |
| aws_ecs_cluster.edge | resource |
| aws_ecs_cluster_capacity_providers.edge | resource |
| aws_iam_instance_profile.ecs_instance_profile | resource |
| aws_iam_role.ecs_instance_role | resource |
| aws_iam_role_policy_attachment.ecs_instance_policy | resource |
| aws_iam_role_policy_attachment.ecs_instance_ssm | resource |
| aws_launch_template.edge_ecs | resource |
| aws_security_group.ecs | resource |
| aws_ami.ecs_optimized | data source |
| aws_iam_policy_document.ecs_assume_role | data source |
| aws_iam_policy_document.ecs_ec2_assume_role | data source |
Inputs¶
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| base_tags | Base tags for resources | map(string) |
{} |
no |
| desired_capacity | Desired number of ECS instances. Keep at least 2 so the edge-api tasks (one per node, distinctInstance) sit on separate nodes in separate AZs. | number |
1 |
no |
| environment | Environment name | string |
n/a | yes |
| group | Logical group/area | string |
"edge" |
no |
| instance_type | EC2 instance type for ECS container instances | string |
n/a | yes |
| max_size | Maximum number of ECS instances. One above desired_capacity, so an instance refresh can launch the replacement node before draining the old one. | number |
2 |
no |
| min_size | Minimum number of ECS instances | number |
1 |
no |
| name_prefix | Prefix for resource names | string |
n/a | yes |
| region | AWS region | string |
n/a | yes |
| subnet_ids | List of Subnet IDs for the ASG | list(string) |
n/a | yes |
| vpc_id | VPC ID where resources will be created | string |
n/a | yes |
Outputs¶
| Name | Description |
|---|---|
| auto_scaling_group_name | Name of the EC2 Auto Scaling Group backing the ECS cluster. |
| cluster_arn | ARN of the ECS cluster |
| cluster_name | Name of the ECS cluster |
| security_group_id | Security group ID of ECS tasks |