File tree Expand file tree Collapse file tree 11 files changed +94
-8
lines changed Expand file tree Collapse file tree 11 files changed +94
-8
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ module "gce-lb-http" {
106106| firewall\_ networks | Names of the networks to create firewall rules in | ` list(string) ` | <pre >[ <br > "default"<br >] </pre > | no |
107107| firewall\_ projects | Names of the projects to create firewall rules in | ` list(string) ` | <pre >[ <br > "default"<br >] </pre > | no |
108108| http\_ forward | Set to ` false ` to disable HTTP port 80 forward | ` bool ` | ` true ` | no |
109+ | http\_ port | The port for the HTTP load balancer | ` number ` | ` 80 ` | no |
110+ | https\_ port | The port for the HTTPS load balancer | ` number ` | ` 443 ` | no |
109111| https\_ redirect | Set to ` true ` to enable https redirect on the lb. | ` bool ` | ` false ` | no |
110112| ipv6\_ address | An existing IPv6 address to use (the actual IP address value) | ` string ` | ` null ` | no |
111113| labels | The labels to attach to resources created by this module | ` map(string) ` | ` {} ` | no |
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ resource "google_compute_global_forwarding_rule" "http" {
3838 name = var.name
3939 target = google_compute_target_http_proxy.default[0].self_link
4040 ip_address = local.address
41- port_range = "80"
41+ port_range = var.http_port
4242 labels = var.labels
4343 load_balancing_scheme = var.load_balancing_scheme
4444 network = local.internal_network
@@ -51,7 +51,7 @@ resource "google_compute_global_forwarding_rule" "https" {
5151 name = "${var.name}-https"
5252 target = google_compute_target_https_proxy.default[0].self_link
5353 ip_address = local.address
54- port_range = "443"
54+ port_range = var.https_port
5555 labels = var.labels
5656 load_balancing_scheme = var.load_balancing_scheme
5757 network = local.internal_network
Original file line number Diff line number Diff line change @@ -317,3 +317,23 @@ variable "server_tls_policy" {
317317 type = string
318318 default = null
319319}
320+
321+ variable "http_port" {
322+ description = "The port for the HTTP load balancer"
323+ type = number
324+ default = 80
325+ validation {
326+ condition = var.http_port >= 1 && var.http_port <= 65535
327+ error_message = "You must specify exactly one port between 1 and 65535"
328+ }
329+ }
330+
331+ variable "https_port" {
332+ description = "The port for the HTTPS load balancer"
333+ type = number
334+ default = 443
335+ validation {
336+ condition = var.https_port >= 1 && var.https_port <= 65535
337+ error_message = "You must specify exactly one port between 1 and 65535"
338+ }
339+ }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ resource "google_compute_global_forwarding_rule" "http" {
3636 name = var. name
3737 target = google_compute_target_http_proxy. default [0 ]. self_link
3838 ip_address = local. address
39- port_range = " 80 "
39+ port_range = var . http_port
4040 labels = var. labels
4141 load_balancing_scheme = var. load_balancing_scheme
4242 network = local. internal_network
@@ -49,7 +49,7 @@ resource "google_compute_global_forwarding_rule" "https" {
4949 name = " ${ var . name } -https"
5050 target = google_compute_target_https_proxy. default [0 ]. self_link
5151 ip_address = local. address
52- port_range = " 443 "
52+ port_range = var . https_port
5353 labels = var. labels
5454 load_balancing_scheme = var. load_balancing_scheme
5555 network = local. internal_network
Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ module "gce-lb-http" {
9999| firewall\_ networks | Names of the networks to create firewall rules in | ` list(string) ` | <pre >[ <br > "default"<br >] </pre > | no |
100100| firewall\_ projects | Names of the projects to create firewall rules in | ` list(string) ` | <pre >[ <br > "default"<br >] </pre > | no |
101101| http\_ forward | Set to ` false ` to disable HTTP port 80 forward | ` bool ` | ` true ` | no |
102+ | http\_ port | The port for the HTTP load balancer | ` number ` | ` 80 ` | no |
103+ | https\_ port | The port for the HTTPS load balancer | ` number ` | ` 443 ` | no |
102104| https\_ redirect | Set to ` true ` to enable https redirect on the lb. | ` bool ` | ` false ` | no |
103105| ipv6\_ address | An existing IPv6 address to use (the actual IP address value) | ` string ` | ` null ` | no |
104106| labels | The labels to attach to resources created by this module | ` map(string) ` | ` {} ` | no |
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ resource "google_compute_global_forwarding_rule" "http" {
3636 name = var. name
3737 target = google_compute_target_http_proxy. default [0 ]. self_link
3838 ip_address = local. address
39- port_range = " 80 "
39+ port_range = var . http_port
4040 labels = var. labels
4141 load_balancing_scheme = var. load_balancing_scheme
4242 network = local. internal_network
@@ -49,7 +49,7 @@ resource "google_compute_global_forwarding_rule" "https" {
4949 name = " ${ var . name } -https"
5050 target = google_compute_target_https_proxy. default [0 ]. self_link
5151 ip_address = local. address
52- port_range = " 443 "
52+ port_range = var . https_port
5353 labels = var. labels
5454 load_balancing_scheme = var. load_balancing_scheme
5555 network = local. internal_network
Original file line number Diff line number Diff line change @@ -304,3 +304,23 @@ variable "server_tls_policy" {
304304 type = string
305305 default = null
306306}
307+
308+ variable "http_port" {
309+ description = " The port for the HTTP load balancer"
310+ type = number
311+ default = 80
312+ validation {
313+ condition = var. http_port >= 1 && var. http_port <= 65535
314+ error_message = " You must specify exactly one port between 1 and 65535"
315+ }
316+ }
317+
318+ variable "https_port" {
319+ description = " The port for the HTTPS load balancer"
320+ type = number
321+ default = 443
322+ validation {
323+ condition = var. https_port >= 1 && var. https_port <= 65535
324+ error_message = " You must specify exactly one port between 1 and 65535"
325+ }
326+ }
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ module "lb-http" {
8282| edge\_ security\_ policy | The resource URL for the edge security policy to associate with the backend service | ` string ` | ` null ` | no |
8383| enable\_ ipv6 | Enable IPv6 address on the CDN load-balancer | ` bool ` | ` false ` | no |
8484| http\_ forward | Set to ` false ` to disable HTTP port 80 forward | ` bool ` | ` true ` | no |
85+ | http\_ port | The port for the HTTP load balancer | ` number ` | ` 80 ` | no |
86+ | https\_ port | The port for the HTTPS load balancer | ` number ` | ` 443 ` | no |
8587| https\_ redirect | Set to ` true ` to enable https redirect on the lb. | ` bool ` | ` false ` | no |
8688| ipv6\_ address | An existing IPv6 address to use (the actual IP address value) | ` string ` | ` null ` | no |
8789| labels | The labels to attach to resources created by this module | ` map(string) ` | ` {} ` | no |
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ resource "google_compute_global_forwarding_rule" "http" {
3535 name = var. name
3636 target = google_compute_target_http_proxy. default [0 ]. self_link
3737 ip_address = local. address
38- port_range = " 80 "
38+ port_range = var . http_port
3939 labels = var. labels
4040 load_balancing_scheme = var. load_balancing_scheme
4141 network = local. internal_network
@@ -48,7 +48,7 @@ resource "google_compute_global_forwarding_rule" "https" {
4848 name = " ${ var . name } -https"
4949 target = google_compute_target_https_proxy. default [0 ]. self_link
5050 ip_address = local. address
51- port_range = " 443 "
51+ port_range = var . https_port
5252 labels = var. labels
5353 load_balancing_scheme = var. load_balancing_scheme
5454 network = local. internal_network
Original file line number Diff line number Diff line change @@ -253,3 +253,23 @@ variable "server_tls_policy" {
253253 type = string
254254 default = null
255255}
256+
257+ variable "http_port" {
258+ description = " The port for the HTTP load balancer"
259+ type = number
260+ default = 80
261+ validation {
262+ condition = var. http_port >= 1 && var. http_port <= 65535
263+ error_message = " You must specify exactly one port between 1 and 65535"
264+ }
265+ }
266+
267+ variable "https_port" {
268+ description = " The port for the HTTPS load balancer"
269+ type = number
270+ default = 443
271+ validation {
272+ condition = var. https_port >= 1 && var. https_port <= 65535
273+ error_message = " You must specify exactly one port between 1 and 65535"
274+ }
275+ }
You can’t perform that action at this time.
0 commit comments