Skip to content

Commit 8abb57b

Browse files
feat: allow enabling global access for PSC endpoints (#577)
1 parent 2477e46 commit 8abb57b

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

modules/private-service-connect/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ If you have a firewall rule blocking egress traffic, you will need to configure
5757
| private\_service\_connect\_ip | The internal IP to be used for the private service connect. | `string` | n/a | yes |
5858
| private\_service\_connect\_name | Private Service Connect endpoint name. Defaults to `global-psconnect-ip` | `string` | `"global-psconnect-ip"` | no |
5959
| project\_id | Project ID for Private Service Connect. | `string` | n/a | yes |
60+
| psc\_global\_access | This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. Defaults to `false` | `bool` | `false` | no |
6061
| service\_directory\_namespace | Service Directory namespace to register the forwarding rule under. | `string` | `null` | no |
6162
| service\_directory\_region | Service Directory region to register this global forwarding rule under. Defaults to `us-central1` if not defined. | `string` | `null` | no |
6263

modules/private-service-connect/main.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ resource "google_compute_global_address" "private_service_connect" {
3131
}
3232

3333
resource "google_compute_global_forwarding_rule" "forwarding_rule_private_service_connect" {
34-
provider = google-beta
35-
project = var.project_id
36-
name = var.forwarding_rule_name
37-
target = var.forwarding_rule_target
38-
network = var.network_self_link
39-
ip_address = google_compute_global_address.private_service_connect.id
40-
load_balancing_scheme = ""
34+
provider = google-beta
35+
project = var.project_id
36+
name = var.forwarding_rule_name
37+
target = var.forwarding_rule_target
38+
network = var.network_self_link
39+
ip_address = google_compute_global_address.private_service_connect.id
40+
load_balancing_scheme = ""
41+
allow_psc_global_access = var.psc_global_access
4142

4243
dynamic "service_directory_registrations" {
4344
for_each = var.service_directory_namespace != null || var.service_directory_region != null ? [1] : []

modules/private-service-connect/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ variable "service_directory_region" {
6868
type = string
6969
default = null
7070
}
71+
72+
variable "psc_global_access" {
73+
description = "This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. Defaults to `false`"
74+
type = bool
75+
default = false
76+
}

0 commit comments

Comments
 (0)