{"id":19442385,"url":"https://github.com/lean-delivery/terraform-module-aws-ecs","last_synced_at":"2025-07-25T16:10:36.437Z","repository":{"id":43195523,"uuid":"161659090","full_name":"lean-delivery/terraform-module-aws-ecs","owner":"lean-delivery","description":"Terraform module for creating AWS Elastic Container Service service","archived":false,"fork":false,"pushed_at":"2023-10-23T13:13:33.000Z","size":48,"stargazers_count":3,"open_issues_count":4,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-25T00:36:57.757Z","etag":null,"topics":["aws","ecs"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lean-delivery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security-group.tf","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-13T15:35:00.000Z","updated_at":"2024-02-05T03:50:24.000Z","dependencies_parsed_at":"2024-11-10T15:42:03.984Z","dependency_job_id":"f091b60c-e6be-49a8-bb62-339fefc51fee","html_url":"https://github.com/lean-delivery/terraform-module-aws-ecs","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/lean-delivery/terraform-module-aws-ecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fterraform-module-aws-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fterraform-module-aws-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fterraform-module-aws-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fterraform-module-aws-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lean-delivery","download_url":"https://codeload.github.com/lean-delivery/terraform-module-aws-ecs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fterraform-module-aws-ecs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267029423,"owners_count":24024202,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","ecs"],"created_at":"2024-11-10T15:39:08.609Z","updated_at":"2025-07-25T16:10:36.416Z","avatar_url":"https://github.com/lean-delivery.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Summary\n\nTerraform module to setup ECS Fargate or ECS EC2.\n\nNew variable \"launch_type\" can be \"FARGATE\" or \"EC2\"\n\n## Example\n\n```HCL\nmodule \"ecs\" {\n  source = \"github.com/lean-delivery/tf-module-aws-ecs\"\n\n  project     = \"Project\"\n  environment = \"dev\"\n  service     = \"service-name\"\n\n  vpc_id  = \"vpc-eizox8ea\"\n  subnets = [\"subnet-sait0aiw\", \"subnet-op8phee4\", \"subnet-eego9xoo\"]\n  availability_zones = [\"eu-west-1a\", \"eu-west-1b\", \"eu-west-1c\"]\n\n  alb_target_group_arn = \"arn:aws:elasticloadbalancing:\u003c region \u003e:\u003c account ID \u003e:targetgroup/\u003c target group name \u003e/\u003c target group id \u003e\"\n\n  container_port       = \"80\"\n\n  container_definitions = \u003c\u003cEOF\n[\n  {\n    \"name\": \"first\",\n    \"image\": \"service-first\",\n    \"cpu\": 10,\n    \"memory\": 512,\n    \"essential\": true,\n    \"portMappings\": [\n      {\n        \"containerPort\": 80,\n        \"hostPort\": 80\n      }\n    ]\n  }\n]\nEOF\n}\n```\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|:----:|:-----:|:-----:|\n| alb\\_target\\_group\\_arn | ARN of target group | string | - | yes |\n| container\\_cpu | Amount of cpu used by the task | string | `512` | no |\n| container\\_definitions | Fargate container definition | string | see default value bellow this table | no |\n| container\\_memory | Amount of memory used by the task | string | `1024` | no |\n| container\\_port | exposed port in container | string | `80` | no |\n| ecs\\_cluster\\_id | ID of existing ECS cluster (if want to attach service and etc to existing cluster) | string | `none` | no |\n| environment | Environment name is used to identify resources | string | `env` | no |\n| health\\_check\\_grace\\_period\\_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks | string | `30` | no |\n| project | Project name is used to identify resources | string | `test` | no |\n| service | Service name (will be used as family name in task definition) | string | `SuperService` | no |\n| subnets | List of subnets where to run ECS Service | list | - | yes |\n| tags | Additional tags for all resources | map | `\u003cmap\u003e` | no |\n| task\\_role\\_arn | ARN of IAM role that should be passed into container to access AWS resources from it. | string | `` | no |\n| use\\_existant\\_cluster | Bool statement to declare usage of existant ECS cluster | string | `false` | no |\n| instance\\_type | Instance type of nodes for ECS with \"EC2\" launch type  | string | `t2.small` | no |\n| launch\\_type | Launch type for ECS (FARGATE or EC2 )  | string | `FARGATE` | no |\n| volume\\_type | Volume type for EC2  | string | `standard` | no |\n| volume\\_size | Volume size for EC2  | string | `100` | no |\n| autoscaling\\_min\\_capacity | Amount of min running task or EC2 instances | string | `1` | no |\n| autoscaling\\_max\\_capacity | Amount of max running task or EC2 instances  | string | `10` | no |\n| autoscaling\\_cpu\\_high\\_threshold | Autoscaling CPU threshold for scale-up  | string | `50` | no |\n| autoscaling\\_cpu\\_low\\_threshold | Autoscaling CPU threshold for scale-down  | string | `40` | no |\n| availability\\_zones | List of availability zones which will be provisined by autoscailing group  | list | `[]` | yes |\n| vpc\\_id | The ID of VPC | string | - | yes |\n| create_security_group | To create or not own security group for service | string | `true` | no |\n| security_groups | List of existing security groups to be reused if create_security_group is false | list | `[]` | no |\n| assign_public_ip | To assign or not public ip to task | string | `false` | no |\n| use_fargate_spot | To use or not spot tasks in Fargate | string | `false` | no |\n\n### Container definitions default value\n\n```HCL\n[\n  {\n    \"name\": \"SuperService-env\",\n    \"cpu\": 512,\n    \"memory\": 512,\n    \"image\": \"nginx:alpine\",\n    \"essential\": true,\n    \"portMappings\": [\n      {\n        \"containerPort\": 80,\n        \"hostPort\": 80\n      }\n    ]\n  }\n]\n```\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| ecs\\_cluster\\_arn | ECS cluster ARN |\n| ecs\\_cluster\\_id | ECS cluster ID |\n| ecs\\_cluster\\_name | ECS cluster name |\n| ecs\\_service\\_iam\\_role\\_arn | ARN fo created ECS service |\n| ecs\\_service\\_iam\\_role\\_name | Name of IAM role that attached to ECS service |\n| ecs\\_task\\_execution\\_container\\_cpu | Amount of cpu used by the task |\n| ecs\\_task\\_execution\\_container\\_memory | Amount of memory used by the task |\n| ecs\\_task\\_execution\\_iam\\_role\\_arn | Arn of IAM role that attached to ECS task execution |\n| ecs\\_task\\_execution\\_iam\\_role\\_name | Name of IAM role that attached to ECS task execution |\n| security\\_group\\_description | The description of the security group. |\n| security\\_group\\_id | The ID of the security group. |\n| security\\_group\\_name | The name of the security group. |\n| security\\_group\\_owner\\_id | The owner ID. |\n| security\\_group\\_vpc\\_id | The VPC ID. |\n\n## License\n\nApache2.0 Licensed. See [LICENSE](https://github.com/lean-delivery/tf-module-aws-ecs/tree/master/LICENSE) for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-delivery%2Fterraform-module-aws-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flean-delivery%2Fterraform-module-aws-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-delivery%2Fterraform-module-aws-ecs/lists"}