Terraform module that spins up a ECS cluster backed by EC2 instances created by an Auto-Scaling Group. The default Security Group configuration on this module is ideal to use with the awsvpc
ECS networking type, if you intend to use the bridge
networking type, you'll need to open ports on the security group.
module "cluster" {
source = "[email protected]:joao-zanutto/terraform-aws-ecs-cluster.git"
env = "dev"
name = "demo"
vpc_id = var.vpc_id # leave empty to use the default VPC
subnet_ids = var.subnet_ids # leave empty to use all VPC subnets
}
Name | Version |
---|---|
terraform | ~> 1.5.0 |
aws | ~> 5.0 |
Name | Version |
---|---|
aws | ~> 5.0 |
No modules.
Name | Type |
---|---|
aws_autoscaling_group.ecs | resource |
aws_ecs_capacity_provider.main | resource |
aws_ecs_cluster.main | resource |
aws_ecs_cluster_capacity_providers.main | resource |
aws_iam_instance_profile.ecs_node | resource |
aws_iam_role.ecs_node_role | resource |
aws_iam_role_policy_attachment.ecs_node_role_policy | resource |
aws_iam_role_policy_attachment.ssm_managed_instance_policy | resource |
aws_launch_template.ecs_ec2 | resource |
aws_security_group.ecs_node_sg | resource |
aws_iam_policy_document.ecs_node_doc | data source |
aws_ssm_parameter.ecs_node_ami | data source |
aws_subnets.default | data source |
aws_vpc.default | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
env | Environment where the cluster will be deployed | string |
"dev" |
no |
name | Name of the cluster | string |
"demo" |
no |
node_instance_type | Instance type used to start nodes in the cluster | string |
"t3.micro" |
no |
subnet_ids | Subnet IDs where the cluster nodes will be deployed - if left empty, will deploy in all subnets in the VPC | list(string) |
[] |
no |
vpc_id | VPC ID where the cluster nodes will be deployed - leave empty to deploy in the default VPC | string |
"" |
no |
No outputs.