diff --git a/README.md b/README.md index c8c9709..41e443e 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ Full functional examples are located in the [examples](./examples/) directory. | health\_check | Health check to determine whether instances are responsive and able to do work |
object({
check_interval_sec = number
healthy_threshold = number
timeout_sec = number
unhealthy_threshold = number
port = number
request_path = string
host = string
})
|
{
"check_interval_sec": null,
"healthy_threshold": null,
"host": null,
"port": null,
"request_path": null,
"timeout_sec": null,
"unhealthy_threshold": null
}
| no | | ip\_address | IP address of the external load balancer, if empty one will be assigned. | `any` | `null` | no | | ip\_protocol | The IP protocol for the frontend forwarding rule and firewall rule. TCP, UDP, ESP, AH, SCTP or ICMP. | `string` | `"TCP"` | no | +| labels | The labels to attach to resources created by this module. | `map(string)` | `{}` | no | | name | Name for the forwarding rule and prefix for supporting resources. | `string` | n/a | yes | | network | Name of the network to create resources in. | `string` | `"default"` | no | | project | The project to deploy to, if not set the default provider project is used. | `string` | `""` | no | diff --git a/main.tf b/main.tf index 29c45b8..35aa5bf 100644 --- a/main.tf +++ b/main.tf @@ -19,6 +19,7 @@ locals { } resource "google_compute_forwarding_rule" "default" { + provider = google-beta project = var.project name = var.name target = google_compute_target_pool.default.self_link @@ -27,6 +28,7 @@ resource "google_compute_forwarding_rule" "default" { region = var.region ip_address = var.ip_address ip_protocol = var.ip_protocol + labels = var.labels } resource "google_compute_target_pool" "default" { diff --git a/variables.tf b/variables.tf index c4c0007..4d15ac6 100644 --- a/variables.tf +++ b/variables.tf @@ -107,5 +107,10 @@ variable "allowed_ips" { description = "The IP address ranges which can access the load balancer." default = ["0.0.0.0/0"] type = list(string) +} +variable "labels" { + description = "The labels to attach to resources created by this module." + default = {} + type = map(string) } diff --git a/versions.tf b/versions.tf index f77c117..45e5305 100644 --- a/versions.tf +++ b/versions.tf @@ -17,15 +17,22 @@ terraform { required_version = ">= 0.13" required_providers { - google = { source = "hashicorp/google" version = ">= 3.53, < 5.0" } + + google-beta = { + source = "hashicorp/google-beta" + version = ">= 3.53, < 5.0" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-lb/v3.1.0" } + provider_meta "google-beta" { + module_name = "blueprints/terraform/terraform-google-lb/v3.1.0" + } }