Skip to content

Commit

Permalink
Merge pull request #150 from reiniervanderhoeven/feature/edge_securit…
Browse files Browse the repository at this point in the history
…y_policy

Feat: added edge_security_policy to nb-psc-l7xlb
  • Loading branch information
danistrebel authored Mar 18, 2024
2 parents 8c425eb + 486325e commit 53b5978
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions modules/mig-l7xlb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_backend_migs"></a> [backend\_migs](#input\_backend\_migs) | List of MIGs to be used as backends. | `list(string)` | n/a | yes |
| <a name="input_backend_timeout"></a> [backend\_timeout](#input\_backend\_timeout) | Backend timeout in seconds | `number` | `10` | no |
| <a name="input_edge_security_policy"></a> [edge\_security\_policy](#input\_edge\_security\_policy) | (Optional) The edge security policy associated with this backend service. | `string` | `null` | no |
| <a name="input_external_ip"></a> [external\_ip](#input\_external\_ip) | (Optional) External IP for the L7 XLB. | `string` | `null` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | An optional map of label key:value pairs to assign to the forwarding rule.<br>Default is an empty map. | `map(string)` | `{}` | no |
| <a name="input_logs_enabled"></a> [logs\_enabled](#input\_logs\_enabled) | Whether to enable logging for the load balancer traffic served by this backend service. | `bool` | `false` | no |
Expand Down
15 changes: 8 additions & 7 deletions modules/mig-l7xlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ resource "google_compute_health_check" "mig_lb_hc" {
}

resource "google_compute_backend_service" "mig_backend" {
project = var.project_id
name = "${var.name}-backend"
port_name = "https"
protocol = "HTTPS"
timeout_sec = var.backend_timeout
health_checks = [google_compute_health_check.mig_lb_hc.id]
security_policy = var.security_policy
project = var.project_id
name = "${var.name}-backend"
port_name = "https"
protocol = "HTTPS"
timeout_sec = var.backend_timeout
health_checks = [google_compute_health_check.mig_lb_hc.id]
security_policy = var.security_policy
edge_security_policy = var.edge_security_policy
dynamic "backend" {
for_each = var.backend_migs
content {
Expand Down
6 changes: 6 additions & 0 deletions modules/mig-l7xlb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ variable "security_policy" {
default = null
}

variable "edge_security_policy" {
description = "(Optional) The edge security policy associated with this backend service."
type = string
default = null
}

variable "logs_enabled" {
type = bool
default = false
Expand Down
1 change: 1 addition & 0 deletions modules/nb-psc-l7xlb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_edge_security_policy"></a> [edge\_security\_policy](#input\_edge\_security\_policy) | (Optional) The edge security policy associated with this backend service. | `string` | `null` | no |
| <a name="input_external_ip"></a> [external\_ip](#input\_external\_ip) | External IP for the L7 XLB. | `string` | `null` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | An optional map of label key:value pairs to assign to the forwarding rule.<br>Default is an empty map. | `map(string)` | `{}` | no |
| <a name="input_name"></a> [name](#input\_name) | External LB name. | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/nb-psc-l7xlb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ resource "google_compute_backend_service" "psc_backend" {
protocol = "HTTPS"
load_balancing_scheme = "EXTERNAL_MANAGED"
security_policy = var.security_policy
edge_security_policy = var.edge_security_policy
dynamic "backend" {
for_each = var.psc_negs
content {
Expand Down
6 changes: 6 additions & 0 deletions modules/nb-psc-l7xlb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ variable "security_policy" {
default = null
}

variable "edge_security_policy" {
description = "(Optional) The edge security policy associated with this backend service."
type = string
default = null
}

variable "psc_negs" {
description = "List of PSC NEGs to be used as backends."
type = list(string)
Expand Down

0 comments on commit 53b5978

Please sign in to comment.