{"id":20925527,"url":"https://github.com/padok-team/terraform-google-lb","last_synced_at":"2025-09-30T00:31:11.996Z","repository":{"id":41284594,"uuid":"422144812","full_name":"padok-team/terraform-google-lb","owner":"padok-team","description":"A Terraform module to create a load balancer on GCP","archived":false,"fork":false,"pushed_at":"2024-12-11T04:56:22.000Z","size":141,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-11T05:27:41.558Z","etag":null,"topics":["google","load-balancer","ready-to-use","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/padok-team.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-28T09:34:13.000Z","updated_at":"2024-11-15T14:12:42.000Z","dependencies_parsed_at":"2024-04-10T23:43:50.025Z","dependency_job_id":"90225694-a4ad-4d9e-9a7b-4364ce425a0c","html_url":"https://github.com/padok-team/terraform-google-lb","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padok-team%2Fterraform-google-lb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padok-team%2Fterraform-google-lb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padok-team%2Fterraform-google-lb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padok-team%2Fterraform-google-lb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padok-team","download_url":"https://codeload.github.com/padok-team/terraform-google-lb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234677952,"owners_count":18870357,"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":["google","load-balancer","ready-to-use","terraform"],"created_at":"2024-11-18T20:33:04.702Z","updated_at":"2025-09-30T00:31:06.541Z","avatar_url":"https://github.com/padok-team.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Load Balancer Terraform module\n\nTerraform module which creates **Load Balancer** resources on **GCP**. \n\u003c!-- This module is an abstraction of the [MODULE_NAME](https://github.com/a_great_module) by [@someoneverysmart](https://github.com/someoneverysmart). --\u003e\n\n## User Stories for this module\n\n- AASRE I can create one load balancer\n- AASRE I can specify multiple backend services\n- AASRE I can specify certificates to be used\n- AASRE I can handle granular routing on LB\n- AASRE I can specify the SSL Policy\n- AASRE I can specify the security policy\n- AASRE I can activate CDN on each backend service\n\n## Usage\n\n```hcl\nmodule \"my_lb\" {\n  source = \"git@github.com:padok-team/terraform-google-lb.git?ref=v1.0.1\"\n\n  name = \"my-lb\"\n  buckets_backends = {\n    frontend = {\n      hosts = [\"example-bucket.playground.padok.cloud\"]\n      path_rules = [\n        {\n          paths = [\"/*\"]\n        }\n      ]\n      bucket_name = \"example-bucket\"\n      cdn_policy  = \"react\"\n    }\n  }\n  service_backends = {\n    backend = {\n      hosts = [\"echo.playground.padok.cloud\"]\n      path_rules = [\n        {\n          paths = [\"/*\"]\n        }\n      ]\n      groups = [google_compute_region_network_endpoint_group.backend.id]\n    }\n  }\n  ssl_certificates    = [data.google_compute_ssl_certificate.playground.self_link]\n  custom_cdn_policies = {}\n}\n```\n\n### Embedded CDN Policies\n\nCurrently, this module only supports the following CDN policy. You can reference it directly in the module usage:\n\n- **react**\n\n```hcl\nreact = {\n  cache_mode       = \"USE_ORIGIN_HEADERS\"\n  negative_caching = true\n  negative_caching_policy = {\n    \"404\" = {\n      code = \"404\"\n      ttl  = \"1\"\n    },\n  }\n}\n```\n\nDon't hesitate to add other CDN policies!\n\nAlternatively, you can set custom CDN Policies as explained in the [Terraform documentation](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_backend_bucket#cdn_policy).\n\n\u003e :warning: The structure of the resource might change, we're based on google provider 3.90 version.\n\n## Usage examples\n\n- [Multiple backend usage](examples/multi-backend-lb/main.tf)\n- [Custom CDN policy usage](examples/custom-cdn-policy/main.tf)\n- [Custom certificate usage](examples/lb-with-custom-certificate/main.tf)\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Modules\n\nNo modules.\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_buckets_backends\"\u003e\u003c/a\u003e [buckets\\_backends](#input\\_buckets\\_backends) | A map of buckets to add as the load balancer backends. | \u003cpre\u003emap(object({\u003cbr\u003e    hosts       = list(string)\u003cbr\u003e    bucket_name = string\u003cbr\u003e    cdn_policy  = optional(string)\u003cbr\u003e    path_rules = list(object({\u003cbr\u003e      paths = list(string)\u003cbr\u003e    }))\u003cbr\u003e    security_policy = optional(string)\u003cbr\u003e  }))\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | The load balancer name. | `string` | n/a | yes |\n| \u003ca name=\"input_project_id\"\u003e\u003c/a\u003e [project\\_id](#input\\_project\\_id) | The project to deploy the ressources to. | `string` | n/a | yes |\n| \u003ca name=\"input_service_backends\"\u003e\u003c/a\u003e [service\\_backends](#input\\_service\\_backends) | A map of services to add as the load balancer backends. | \u003cpre\u003emap(object({\u003cbr\u003e    hosts  = list(string)\u003cbr\u003e    groups = list(string)\u003cbr\u003e    path_rules = list(object({\u003cbr\u003e      paths = list(string)\u003cbr\u003e    }))\u003cbr\u003e    security_policy = optional(string)\u003cbr\u003e  }))\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_custom_cdn_policies\"\u003e\u003c/a\u003e [custom\\_cdn\\_policies](#input\\_custom\\_cdn\\_policies) | A map of additional custom CDN policies you can add to the load balancer. | \u003cpre\u003emap(object({\u003cbr\u003e    cache_mode       = optional(string, null)\u003cbr\u003e    client_ttl       = optional(number, null)\u003cbr\u003e    default_ttl      = optional(number, null)\u003cbr\u003e    max_ttl          = optional(number, null)\u003cbr\u003e    negative_caching = optional(bool, null)\u003cbr\u003e    negative_caching_policy = optional(map(object({\u003cbr\u003e      code = optional(number, null)\u003cbr\u003e      ttl  = optional(number, null)\u003cbr\u003e    })), null)\u003cbr\u003e    serve_while_stale            = optional(number, null)\u003cbr\u003e    signed_url_cache_max_age_sec = optional(number, null)\u003cbr\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_ip_address\"\u003e\u003c/a\u003e [ip\\_address](#input\\_ip\\_address) | The load balancer's IP address. | `string` | `\"\"` | no |\n| \u003ca name=\"input_ssl_certificates\"\u003e\u003c/a\u003e [ssl\\_certificates](#input\\_ssl\\_certificates) | A list of SSL certificates for the load balancer. | `list(string)` | `[]` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_ip_address\"\u003e\u003c/a\u003e [ip\\_address](#output\\_ip\\_address) | The IP address of the load balancer. |\n\u003c!-- END_TF_DOCS --\u003e\n\n## License\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nSee [LICENSE](LICENSE) for full details.\n\n```text\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\n  https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadok-team%2Fterraform-google-lb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadok-team%2Fterraform-google-lb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadok-team%2Fterraform-google-lb/lists"}