{"id":29019621,"url":"https://github.com/senora-dev/terraform-aws-load-balancer","last_synced_at":"2026-02-01T22:31:48.497Z","repository":{"id":301182297,"uuid":"1000665513","full_name":"Senora-dev/terraform-aws-load-balancer","owner":"Senora-dev","description":"Terraform module which creates Application and Network Load Balancer resources on AWS.","archived":false,"fork":false,"pushed_at":"2025-06-25T14:48:27.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T15:37:46.799Z","etag":null,"topics":[],"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/Senora-dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T06:22:58.000Z","updated_at":"2025-06-25T14:38:44.000Z","dependencies_parsed_at":"2025-06-25T15:37:51.485Z","dependency_job_id":"bfed02f9-717d-4c59-bd35-c88e40f33e19","html_url":"https://github.com/Senora-dev/terraform-aws-load-balancer","commit_stats":null,"previous_names":["senora-dev/terraform-aws-load-balancer"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Senora-dev/terraform-aws-load-balancer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senora-dev%2Fterraform-aws-load-balancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senora-dev%2Fterraform-aws-load-balancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senora-dev%2Fterraform-aws-load-balancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senora-dev%2Fterraform-aws-load-balancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Senora-dev","download_url":"https://codeload.github.com/Senora-dev/terraform-aws-load-balancer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senora-dev%2Fterraform-aws-load-balancer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261977540,"owners_count":23239367,"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":[],"created_at":"2025-06-26T00:31:22.829Z","updated_at":"2026-02-01T22:31:48.490Z","avatar_url":"https://github.com/Senora-dev.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Load Balancer Terraform module\n\nTerraform module which creates Application and Network Load Balancer resources on AWS.\n\n## Features\n\n- Supports both Application Load Balancer (ALB) and Network Load Balancer (NLB)\n- Conditional creation of resources\n- Support for HTTP/HTTPS/TCP/TLS listeners\n- Support for ALB listener rules with various conditions\n- Support for target groups with customizable health checks\n- Access logging to S3 bucket\n- Subnet mapping with optional EIP allocation for NLB\n- Security group management for ALB\n- Tags propagation\n\n## Usage\n\n### Application Load Balancer (ALB)\n\n```hcl\nmodule \"alb\" {\n  source = \"Senora-dev/load-balancer/aws\"\n\n  name               = \"my-alb\"\n  load_balancer_type = \"application\"\n  vpc_id             = \"vpc-abcde012\"\n  subnets            = [\"subnet-abcde012\", \"subnet-bcde012a\"]\n  security_groups    = [\"sg-edcd9784\", \"sg-edcd9785\"]\n\n  access_logs = {\n    bucket = \"my-alb-logs\"\n  }\n\n  target_groups = {\n    ex-instance = {\n      name_prefix      = \"h1\"\n      protocol        = \"HTTP\"\n      port            = 80\n      target_type     = \"instance\"\n      \n      health_check = {\n        enabled             = true\n        interval           = 30\n        path               = \"/health\"\n        port               = \"traffic-port\"\n        healthy_threshold   = 3\n        unhealthy_threshold = 3\n        timeout            = 6\n        protocol          = \"HTTP\"\n        matcher           = \"200-399\"\n      }\n    }\n  }\n\n  https_listeners = {\n    ex-https = {\n      port               = 443\n      protocol          = \"HTTPS\"\n      certificate_arn   = \"arn:aws:acm:eu-west-1:0123456789012:certificate/abc123\"\n      \n      default_action = {\n        type             = \"forward\"\n        target_group_arn = \"arn:aws:elasticloadbalancing:eu-west-1:0123456789012:targetgroup/ex-instance/1234567890123\"\n      }\n    }\n  }\n\n  http_tcp_listeners = {\n    ex-http-https-redirect = {\n      port     = 80\n      protocol = \"HTTP\"\n      \n      default_action = {\n        type = \"redirect\"\n        redirect = {\n          port        = \"443\"\n          protocol    = \"HTTPS\"\n          status_code = \"HTTP_301\"\n        }\n      }\n    }\n  }\n\n  tags = {\n    Environment = \"Production\"\n    Project     = \"Example\"\n  }\n}\n```\n\n### Network Load Balancer (NLB)\n\n```hcl\nmodule \"nlb\" {\n  source = \"terraform-aws-modules/load-balancer/aws\"\n\n  name               = \"my-nlb\"\n  load_balancer_type = \"network\"\n  vpc_id             = \"vpc-abcde012\"\n\n  subnet_mappings = [\n    {\n      subnet_id     = \"subnet-abcde012\"\n      allocation_id = \"eipalloc-abcde012\"\n    },\n    {\n      subnet_id     = \"subnet-bcde012a\"\n      allocation_id = \"eipalloc-bcde012a\"\n    }\n  ]\n\n  target_groups = {\n    ex-tcp = {\n      name_prefix      = \"tcp\"\n      protocol        = \"TCP\"\n      port            = 80\n      target_type     = \"instance\"\n      \n      health_check = {\n        enabled             = true\n        interval           = 30\n        port               = \"traffic-port\"\n        protocol          = \"TCP\"\n        healthy_threshold   = 3\n        unhealthy_threshold = 3\n      }\n    }\n  }\n\n  listeners = {\n    ex-tcp = {\n      port     = 80\n      protocol = \"TCP\"\n      \n      default_action = {\n        type             = \"forward\"\n        target_group_arn = \"arn:aws:elasticloadbalancing:eu-west-1:0123456789012:targetgroup/ex-tcp/1234567890123\"\n      }\n    }\n  }\n\n  tags = {\n    Environment = \"Production\"\n    Project     = \"Example\"\n  }\n}\n```\n\n## Examples\n\n- [Complete ALB and NLB example](examples/complete) - Creates Application and Network Load Balancers with various configurations\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | \u003e= 1.0 |\n| aws | \u003e= 4.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| aws | \u003e= 4.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| aws_lb.this | resource |\n| aws_lb_listener.this | resource |\n| aws_lb_listener_rule.this | resource |\n| aws_lb_target_group.this | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| create | Determines whether resources will be created | `bool` | `true` | no |\n| name | The name of the LB. This name must be unique within your AWS account | `string` | n/a | yes |\n| use_name_prefix | Determines whether to use `name` as is or create a unique name beginning with the `name` as the prefix | `bool` | `true` | no |\n| load_balancer_type | The type of load balancer to create. Possible values are application, gateway, or network | `string` | `\"application\"` | no |\n| internal | Determines if the load balancer is internal or externally facing | `bool` | `false` | no |\n| security_groups | A list of security group IDs to assign to the LB | `list(string)` | `[]` | no |\n| subnets | A list of subnet IDs to attach to the LB | `list(string)` | `[]` | no |\n| subnet_mappings | A list of subnet mapping blocks describing subnets to attach to network load balancer | `list(object)` | `[]` | no |\n| vpc_id | VPC id where the load balancer and other resources will be deployed | `string` | `null` | no |\n| access_logs | Map containing access logging configuration for load balancer | `map(string)` | `{}` | no |\n| target_groups | Map of target group configurations to create | `any` | `{}` | no |\n| listeners | Map of listener configurations to create | `any` | `{}` | no |\n| listener_rules | Map of listener rules to create | `any` | `{}` | no |\n| tags | A map of tags to add to all resources | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| id | The ID and ARN of the load balancer we created |\n| arn | The ARN of the load balancer we created |\n| arn_suffix | ARN suffix of our load balancer - can be used with CloudWatch |\n| dns_name | The DNS name of the load balancer |\n| zone_id | The zone_id of the load balancer to assist with creating DNS records |\n| listeners | Map of listeners created and their attributes |\n| listener_rules | Map of listener rules created and their attributes |\n| target_groups | Map of target groups created and their attributes |\n\n## License\n\nMIT Licensed. See LICENSE for full details.\n\n## Maintainers\n\nThis module is maintained by [Senora.dev](https://senora.dev). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenora-dev%2Fterraform-aws-load-balancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenora-dev%2Fterraform-aws-load-balancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenora-dev%2Fterraform-aws-load-balancer/lists"}