Skip to content

Commit b46a99f

Browse files
committed
feat(cloud_sql): add ipv6 psc endpoint examples
1 parent d71a98b commit b46a99f

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

cloud_sql/mysql_instance_psc/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,21 @@ resource "google_compute_forwarding_rule" "default" {
5757
ip_address = google_compute_address.default.self_link
5858
load_balancing_scheme = ""
5959
target = data.google_sql_database_instance.default.psc_service_attachment_link
60+
allow_psc_global_access = true
6061
}
6162
# [END cloud_sql_mysql_instance_psc_endpoint]
63+
64+
# [START cloud_sql_mysql_instance_ipv6_psc_endpoint]
65+
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
66+
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
67+
region = "us-central1"
68+
69+
load_balancing_scheme = ""
70+
target = data.google_sql_database_instance.default.psc_service_attachment_link
71+
all_ports = true
72+
network = "default" # Replace value with the name of the network here.
73+
subnetwork = "default" # Replace value with the name of the subnet here.
74+
ip_version = "IPV6"
75+
allow_psc_global_access = true
76+
}
77+
# [END cloud_sql_mysql_instance_ipv6_psc_endpoint]

cloud_sql/postgres_instance_psc/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,21 @@ resource "google_compute_forwarding_rule" "default" {
5656
ip_address = google_compute_address.default.self_link
5757
load_balancing_scheme = ""
5858
target = data.google_sql_database_instance.default.psc_service_attachment_link
59+
allow_psc_global_access = true
5960
}
6061
# [END cloud_sql_postgres_instance_psc_endpoint]
62+
63+
# [START cloud_sql_postgres_instance_ipv6_psc_endpoint]
64+
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
65+
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
66+
region = "us-central1"
67+
68+
load_balancing_scheme = ""
69+
target = data.google_sql_database_instance.default.psc_service_attachment_link
70+
all_ports = true
71+
network = "default" # Replace value with the name of the network here.
72+
subnetwork = "default" # Replace value with the name of the subnet here.
73+
ip_version = "IPV6"
74+
allow_psc_global_access = true
75+
}
76+
# [END cloud_sql_postgres_instance_ipv6_psc_endpoint]

cloud_sql/sqlserver_instance_psc/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,21 @@ resource "google_compute_forwarding_rule" "default" {
5858
ip_address = google_compute_address.default.self_link
5959
load_balancing_scheme = ""
6060
target = data.google_sql_database_instance.default.psc_service_attachment_link
61+
allow_psc_global_access = true
6162
}
6263
# [END cloud_sql_sqlserver_instance_psc_endpoint]
64+
65+
# [START cloud_sql_sqlserver_instance_ipv6_psc_endpoint]
66+
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
67+
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
68+
region = "us-central1"
69+
70+
load_balancing_scheme = ""
71+
target = data.google_sql_database_instance.default.psc_service_attachment_link
72+
all_ports = true
73+
network = "default" # Replace value with the name of the network here.
74+
subnetwork = "default" # Replace value with the name of the subnet here.
75+
ip_version = "IPV6"
76+
allow_psc_global_access = true
77+
}
78+
# [END cloud_sql_sqlserver_instance_ipv6_psc_endpoint]

0 commit comments

Comments
 (0)