{"id":23184210,"url":"https://github.com/tierratelematics/terraform-aws-ec2","last_synced_at":"2026-04-15T09:31:12.650Z","repository":{"id":98226320,"uuid":"96115552","full_name":"tierratelematics/terraform-aws-ec2","owner":"tierratelematics","description":"Terraform module to build an AWS EC2 Auto Scaling Groups, ELB and ELBv2 (ALB)","archived":false,"fork":false,"pushed_at":"2017-11-17T09:40:39.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-28T16:49:42.437Z","etag":null,"topics":["alb","auto-scaling-group","aws","ec2","elb","elbv2","terraform"],"latest_commit_sha":null,"homepage":"","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/tierratelematics.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-03T13:46:59.000Z","updated_at":"2019-11-14T03:23:31.000Z","dependencies_parsed_at":"2023-05-18T18:15:30.176Z","dependency_job_id":null,"html_url":"https://github.com/tierratelematics/terraform-aws-ec2","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/tierratelematics/terraform-aws-ec2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierratelematics%2Fterraform-aws-ec2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierratelematics%2Fterraform-aws-ec2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierratelematics%2Fterraform-aws-ec2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierratelematics%2Fterraform-aws-ec2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tierratelematics","download_url":"https://codeload.github.com/tierratelematics/terraform-aws-ec2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierratelematics%2Fterraform-aws-ec2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31834494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["alb","auto-scaling-group","aws","ec2","elb","elbv2","terraform"],"created_at":"2024-12-18T09:17:55.262Z","updated_at":"2026-04-15T09:31:12.636Z","avatar_url":"https://github.com/tierratelematics.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-ec2\n\nThis repository is a set of Terraform modules for building infrastructure with AWS EC2.\n\n## Quickstart\n\nThe easiest way to get the modules and running is by creating a Terraform definition for it, copy this snippet in a file\nnamed `main.tf`:\n\n```hcl\nmodule \"auto-scaling-group\" {\n  source = \"git::https://github.com/tierratelematics/terraform-aws-ec2.git//modules/auto-scaling-group-alb?ref=0.4.0\"\n\n  project                     = \"${var.project}\"\n  environment                 = \"${terraform.env}\"\n  name                        = \"backend\"\n  ami                         = \"${data.aws_ami.version.id}\"\n  \n  vpc_id                      = \"${var.vpc_id}\"\n  vpc_availability_zones      = \"${var.vpc_availability_zones}\"\n  vpc_subnets                 = \"${var.vpc_subnets}\"\n  \n  instance_type               = \"${var.instance_type}\"\n  desired_capacity            = \"${var.desired_capacity}\"\n  min_size                    = \"${var.min_size}\"\n  max_size                    = \"${var.max_size}\"\n\n  associate_public_ip_address = \"${var.associate_public_ip_address}\"\n\n  alb_target_port             = \"8080\"\n  alb_certificate_arn         = \"${var.alb_certificate_arn}\"\n}\n```\n\n## IAM Instance Profile\n\nIf you instance access AWS service you cou can specify an instance profile using the parameter `iam_instance_profile`.\n\n```hcl\nmodule \"auto-scaling-group\" {\n  source = \"git::https://github.com/tierratelematics/terraform-aws-ec2.git//modules/auto-scaling-group-alb?ref=0.4.0\"\n\n  project                     = \"${var.project}\"\n  environment                 = \"${terraform.env}\"\n  ...\n\n  iam_instance_profile        = \"${aws_iam_instance_profile.backend-asg-profile.name}\"\n}\n\nresource \"aws_iam_instance_profile\" \"backend-asg-profile\" {\n  name = \"${var.project}-${var.environment}-backend-asg-profile\"\n  role = \"${module.asg-server-role.role_name}\"\n}\n\nmodule \"asg-server-role\" {\n  source = \"git::https://github.com/tierratelematics/terraform-aws-iam.git///modules/iam/role\"\n  \n  ...\n}\n```\n\nIf you need a Terraform module to build a IAM Role checkout https://github.com/tierratelematics/terraform-aws-iam.\n\n\n## User Data\n\nYou can also specify a custom `user_data` parameter, using the handy `template_file` _data source_.\n\n```hcl\nmodule \"auto-scaling-group\" {\n  source = \"git::https://github.com/tierratelematics/terraform-aws-ec2.git//modules/auto-scaling-group-alb?ref=0.4.0\"\n\n  project                     = \"${var.project}\"\n  environment                 = \"${terraform.env}\"\n  ...\n\n  user_data = \"${data.template_file.user-data.rendered}\"\n}\n\ndata \"template_file\" \"user-data\" {\n  template = \"${file(\"services/backend/user-data.sh\")}\"\n\n  vars {\n    project     = \"${var.project}\"\n    environment = \"${var.environment}\"\n\n    ...\n\n    redis_host = \"${var.redis[\"host\"]}\"\n    redis_port = \"${var.redis[\"port\"]}\"\n  }\n}\n```\n\n## Maintenance Ports\n\nIf you need to expose some ports to access maintenance services use the `ec2_maintenance_ports` parameter.\n\n```hcl\nmodule \"auto-scaling-group\" {\n  source = \"git::https://github.com/tierratelematics/terraform-aws-ec2.git//modules/auto-scaling-group-alb?ref=0.4.0\"\n\n  project                     = \"${var.project}\"\n  environment                 = \"${terraform.env}\"\n  ...\n\n  ec2_maintenance_ports       = [22, 2551, 8551]\n}\n```\n\n## License\n\nCopyright 2017 Tierra SpA\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftierratelematics%2Fterraform-aws-ec2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftierratelematics%2Fterraform-aws-ec2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftierratelematics%2Fterraform-aws-ec2/lists"}