{"id":27146244,"url":"https://github.com/ryands17/terraform-ecs","last_synced_at":"2026-05-05T12:31:47.523Z","repository":{"id":47970613,"uuid":"207871565","full_name":"ryands17/terraform-ecs","owner":"ryands17","description":"A sample Node app deployed to ECS and infrastructure created via Terraform","archived":false,"fork":false,"pushed_at":"2021-08-11T11:22:12.000Z","size":354,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-18T07:45:51.638Z","etag":null,"topics":["aws","nodejs","terraform"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryands17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-11T17:43:42.000Z","updated_at":"2024-05-18T07:45:51.638Z","dependencies_parsed_at":"2022-08-12T15:31:25.996Z","dependency_job_id":null,"html_url":"https://github.com/ryands17/terraform-ecs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryands17%2Fterraform-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryands17%2Fterraform-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryands17%2Fterraform-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryands17%2Fterraform-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryands17","download_url":"https://codeload.github.com/ryands17/terraform-ecs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819947,"owners_count":21001394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","nodejs","terraform"],"created_at":"2025-04-08T10:10:03.702Z","updated_at":"2026-05-05T12:31:42.497Z","avatar_url":"https://github.com/ryands17.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Terraform ECS\n\n#### A [Terraform](https://www.terraform.io) structure for setting up an ECS cluster on EC2 instances.\n\n- A sample Node app will be deployed on AWS ECS with auto-scaling behind a load balancer.\n\nThe following variables along with their examples below are used to create this environment\nUsually these go in the `terraform.tfvars` file\n\n```tf\naws_region = \"us-east-1\"\n\navailability_zones = [\n  \"us-east-1a\",\n  \"us-east-1b\",\n]\n\necs_cluster = \"cluster name\"\n\nvpc = {\n  \"vpc_name\"                    = \"vpc-name\"\n  \"cidr_block\"                  = \"any cidr block of your choice\"\n  \"cidr_blocks\"                 = \"[an array of subnet cidr blocks]\"\n  \"internet_gateway_name\"       = \"internet gateway name\"\n  \"elastic_ip_name\"             = \"elastic ip name\"\n  \"nat_gateway\"                 = \"nat gateway name\"\n  \"public_subnet_names\"         = \"[an array of public subnet names]\"\n  \"private_subnet_names\"        = \"[an array of private subnet names]\"\n  \"public_route_table_name\"     = \"public rt\"\n  \"private_route_table_name\"    = \"private rt\"\n  \"public_security_group_name\"  = \"public sg name\"\n  \"private_security_group_name\" = \"private sg name\"\n}\n\nlaunch_config = {\n  \"name\"                  = \"launch-config-name\"\n  \"image_id\"              = \"ecs optimized image id\"\n  \"instance_type\"         = \"t2.micro\" # scale according to your needs\n  \"public_ip\"             = \"true or false depending on public/private subnet\"\n  \"root_volume_size\"      = 30 # or any value of your size\n  \"delete_on_termination\" = true\n}\nauto_scaling = {\n  \"name\"                  = \"auto scaling group name\"\n  \"maximum_instance_size\" = 3\n  \"minimum_instance_size\" = 2\n  \"desired_capacity\"      = 2\n  \"health_check_type\"     = \"ELB\" # for load balancer health check\n}\n\ntask_definition = {\n  \"family\"     = \"task definition name\"\n  \"image_name\" = \"image:arn from ECR\"\n  \"name\"       = \"name\"\n  \"essential\"  = true\n  \"memory\"     = 256\n}\n\necs_service = {\n  \"name\"               = \"ecs service\"\n  \"min_health_percent\" = 50\n  \"max_health_percent\" = 200\n  \"load_balancer_port\" = 80\n}\n\nload_balancer = {\n  \"name\"         = \"alb\"\n  \"idle_timeout\" = 300\n  \"port\"         = 80\n  \"protocol\"     = \"HTTP\"\n  \"type\"         = \"forward\"\n}\n\nhealth_check = {\n  \"healthy_threshold\"   = \"5\"\n  \"unhealthy_threshold\" = \"3\"\n  \"interval\"            = \"60\"\n  \"matcher\"             = \"200\"\n  \"path\"                = \"/url\"\n  \"port\"                = \"traffic-port\"\n  \"protocol\"            = \"HTTP\"\n  \"timeout\"             = \"10\"\n}\n\ntarget_group = {\n  \"name\"     = \"target group name\"\n  \"port\"     = 80\n  \"protocol\" = \"HTTP\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryands17%2Fterraform-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryands17%2Fterraform-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryands17%2Fterraform-ecs/lists"}