@@ -52,11 +52,49 @@ data "google_sql_database_instance" "default" {
5252}
5353
5454resource "google_compute_forwarding_rule" "default" {
55- name = " psc-forwarding-rule-${ google_sql_database_instance . default . name } "
56- region = " us-central1"
57- network = " default"
58- ip_address = google_compute_address. default . self_link
59- load_balancing_scheme = " "
60- target = data. google_sql_database_instance . default . psc_service_attachment_link
55+ name = " psc-forwarding-rule-${ google_sql_database_instance . default . name } "
56+ region = " us-central1"
57+ network = " default"
58+ ip_address = google_compute_address. default . self_link
59+ load_balancing_scheme = " "
60+ 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_network" "ipv6_default" {
67+ name = " net-ipv6"
68+ auto_create_subnetworks = false
69+ enable_ula_internal_ipv6 = true
70+ }
71+
72+ resource "google_compute_subnetwork" "ipv6_default" {
73+ name = " subnet-internal-ipv6"
74+ ip_cidr_range = " 10.0.0.0/16"
75+ region = " us-central1"
76+ stack_type = " IPV4_IPV6"
77+ ipv6_access_type = " INTERNAL"
78+ network = google_compute_network. ipv6_default . id
79+ }
80+
81+ resource "google_compute_address" "ipv6_default" {
82+ name = " psc-compute-ipv6-address-${ google_sql_database_instance . default . name } "
83+ region = " us-central1"
84+ address_type = " INTERNAL"
85+ subnetwork = google_compute_subnetwork. ipv6_default . name
86+ ip_version = " IPV6"
87+ }
88+
89+ resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
90+ name = " ipv6-psc-forwarding-rule-${ google_sql_database_instance . default . name } "
91+ region = " us-central1"
92+
93+ load_balancing_scheme = " "
94+ target = data. google_sql_database_instance . default . psc_service_attachment_link
95+ network = google_compute_network. ipv6_default . name
96+ subnetwork = google_compute_subnetwork. ipv6_default . name
97+ ip_address = google_compute_address. ipv6_default . id
98+ allow_psc_global_access = true
99+ }
100+ # [END cloud_sql_sqlserver_instance_ipv6_psc_endpoint]
0 commit comments