Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions cloud_sql/mysql_instance_psc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,27 @@ data "google_sql_database_instance" "default" {
}

resource "google_compute_forwarding_rule" "default" {
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
allow_psc_global_access = true
}
# [END cloud_sql_mysql_instance_psc_endpoint]

# [START cloud_sql_mysql_instance_ipv6_psc_endpoint]
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"

load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
all_ports = true
network = "default" # Replace value with the name of the network here.
subnetwork = "default" # Replace value with the name of the subnet here.
ip_version = "IPV6"
allow_psc_global_access = true
}
# [END cloud_sql_mysql_instance_ipv6_psc_endpoint]
28 changes: 22 additions & 6 deletions cloud_sql/postgres_instance_psc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,27 @@ data "google_sql_database_instance" "default" {
}

resource "google_compute_forwarding_rule" "default" {
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
allow_psc_global_access = true
}
# [END cloud_sql_postgres_instance_psc_endpoint]

# [START cloud_sql_postgres_instance_ipv6_psc_endpoint]
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"

load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
all_ports = true
network = "default" # Replace value with the name of the network here.
subnetwork = "default" # Replace value with the name of the subnet here.
ip_version = "IPV6"
allow_psc_global_access = true
}
# [END cloud_sql_postgres_instance_ipv6_psc_endpoint]
28 changes: 22 additions & 6 deletions cloud_sql/sqlserver_instance_psc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,27 @@ data "google_sql_database_instance" "default" {
}

resource "google_compute_forwarding_rule" "default" {
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
name = "psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"
network = "default"
ip_address = google_compute_address.default.self_link
load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
allow_psc_global_access = true
}
# [END cloud_sql_sqlserver_instance_psc_endpoint]

# [START cloud_sql_sqlserver_instance_ipv6_psc_endpoint]
resource "google_compute_forwarding_rule" "ipv6_ilb_example" {
name = "ipv6-psc-forwarding-rule-${google_sql_database_instance.default.name}"
region = "us-central1"

load_balancing_scheme = ""
target = data.google_sql_database_instance.default.psc_service_attachment_link
all_ports = true
network = "default" # Replace value with the name of the network here.
subnetwork = "default" # Replace value with the name of the subnet here.
ip_version = "IPV6"
allow_psc_global_access = true
}
# [END cloud_sql_sqlserver_instance_ipv6_psc_endpoint]