Skip to content

Commit d4855d6

Browse files
sanadhisimrannayer
andauthored
feat: Add service_directory_registrations: namespace and service_directory_region (#548)
Co-authored-by: Imran Nayer <[email protected]>
1 parent 9fbf021 commit d4855d6

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

docs/upgrading_to_v10.0.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Upgrading to v10.0.0
2+
3+
The v10.0 release contains backwards-incompatible changes.
4+
5+
This update requires upgrading the minimum provider version of `hashicorp/google` from `3.50` to `5.8` and `hashicorp/google-beta` from `3.50` to `5.8`.

modules/private-service-connect/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ 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+
| service\_directory\_namespace | Service Directory namespace to register the forwarding rule under. | `string` | `null` | no |
61+
| service\_directory\_region | Service Directory region to register this global forwarding rule under. Defaults to `us-central1` if not defined. | `string` | `null` | no |
6062

6163
## Outputs
6264

modules/private-service-connect/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ resource "google_compute_global_forwarding_rule" "forwarding_rule_private_servic
3838
network = var.network_self_link
3939
ip_address = google_compute_global_address.private_service_connect.id
4040
load_balancing_scheme = ""
41+
42+
dynamic "service_directory_registrations" {
43+
for_each = var.service_directory_namespace != null || var.service_directory_region != null ? [1] : []
44+
45+
content {
46+
namespace = var.service_directory_namespace
47+
service_directory_region = var.service_directory_region
48+
}
49+
}
4150
}

modules/private-service-connect/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,15 @@ variable "forwarding_rule_target" {
5656
error_message = "For forwarding_rule_target only `all-apis` and `vpc-sc` are valid."
5757
}
5858
}
59+
60+
variable "service_directory_namespace" {
61+
description = "Service Directory namespace to register the forwarding rule under."
62+
type = string
63+
default = null
64+
}
65+
66+
variable "service_directory_region" {
67+
description = "Service Directory region to register this global forwarding rule under. Defaults to `us-central1` if not defined."
68+
type = string
69+
default = null
70+
}

modules/private-service-connect/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ terraform {
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 3.50, < 6"
22+
version = ">= 5.8, < 6"
2323
}
2424
google-beta = {
2525
source = "hashicorp/google-beta"
26-
version = ">= 3.50, < 6"
26+
version = ">= 5.8, < 6"
2727
}
2828
}
2929

0 commit comments

Comments
 (0)