Terraform module which creates Load Balancer resources on GCP.
- AASRE I can create one load balancer
- AASRE I can specify multiple backend services
- AASRE I can specify certificates to be used
- AASRE I can handle granular routing on LB
- AASRE I can specify the SSL Policy
- AASRE I can specify the security policy
- AASRE I can activate CDN on each backend service
module "my_lb" {
source = "git@github.com:padok-team/terraform-google-lb.git?ref=v1.0.1"
name = "my-lb"
buckets_backends = {
frontend = {
hosts = ["example-bucket.playground.padok.cloud"]
path_rules = [
{
paths = ["/*"]
}
]
bucket_name = "example-bucket"
cdn_policy = "react"
}
}
service_backends = {
backend = {
hosts = ["echo.playground.padok.cloud"]
path_rules = [
{
paths = ["/*"]
}
]
groups = [google_compute_region_network_endpoint_group.backend.id]
}
}
ssl_certificates = [data.google_compute_ssl_certificate.playground.self_link]
custom_cdn_policies = {}
}
Currently, this module only supports the following CDN policy. You can reference it directly in the module usage:
- react
react = {
cache_mode = "USE_ORIGIN_HEADERS"
negative_caching = true
negative_caching_policy = {
"404" = {
code = "404"
ttl = "1"
},
}
}
Don't hesitate to add other CDN policies!
Alternatively, you can set custom CDN Policies as explained in the Terraform documentation.
⚠️ The structure of the resource might change, we're based on google provider 3.90 version.
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
buckets_backends | A map of buckets to add as the load balancer backends. | map(object({ |
n/a | yes |
name | The load balancer name. | string |
n/a | yes |
project_id | The project to deploy the ressources to. | string |
n/a | yes |
service_backends | A map of services to add as the load balancer backends. | map(object({ |
n/a | yes |
custom_cdn_policies | A map of additional custom CDN policies you can add to the load balancer. | map(object({ |
{} |
no |
ip_address | The load balancer's IP address. | string |
"" |
no |
ssl_certificates | A list of SSL certificates for the load balancer. | list(string) |
[] |
no |
Name | Description |
---|---|
ip_address | The IP address of the load balancer. |
See LICENSE for full details.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.