Skip to content

Commit 31510cc

Browse files
authored
Merge pull request terraform-google-modules#23 from jmound/add-security-policy
Add security_policy support
2 parents fc98b6b + 76b21e3 commit 31510cc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

main.tf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ resource "google_compute_url_map" "default" {
7676
}
7777

7878
resource "google_compute_backend_service" "default" {
79-
project = "${var.project}"
80-
count = "${length(var.backend_params)}"
81-
name = "${var.name}-backend-${count.index}"
82-
port_name = "${element(split(",", element(var.backend_params, count.index)), 1)}"
83-
protocol = "HTTP"
84-
timeout_sec = "${element(split(",", element(var.backend_params, count.index)), 3)}"
85-
backend = ["${var.backends["${count.index}"]}"]
86-
health_checks = ["${element(google_compute_http_health_check.default.*.self_link, count.index)}"]
79+
project = "${var.project}"
80+
count = "${length(var.backend_params)}"
81+
name = "${var.name}-backend-${count.index}"
82+
port_name = "${element(split(",", element(var.backend_params, count.index)), 1)}"
83+
protocol = "HTTP"
84+
timeout_sec = "${element(split(",", element(var.backend_params, count.index)), 3)}"
85+
backend = ["${var.backends["${count.index}"]}"]
86+
health_checks = ["${element(google_compute_http_health_check.default.*.self_link, count.index)}"]
87+
security_policy = "${var.security_policy}"
8788
}
8889

8990
resource "google_compute_http_health_check" "default" {

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,8 @@ variable ssl_certificates {
9494
description = "SSL cert self_link list. Required if `ssl` is `true` and no `private_key` and `certificate` is provided."
9595
default = []
9696
}
97+
98+
variable security_policy {
99+
description = "The resource URL for the security policy to associate with the backend service"
100+
default = ""
101+
}

0 commit comments

Comments
 (0)