Created
October 12, 2022 14:40
-
-
Save marvinhoxha/96a67c6adaea7f95bc2d27cab25e96aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "google_datastream_private_connection" "default" { | |
project = var.project | |
display_name = "Private connection profile" | |
location = var.region | |
private_connection_id = "my-connection" | |
vpc_peering_config { | |
vpc = data.google_compute_network.network.id | |
subnet = "10.1.0.0/29" | |
} | |
} | |
resource "google_compute_firewall" "default" { | |
project = var.project | |
name = "datastream-proxy-access" | |
network = data.google_compute_network.network.name | |
allow { | |
protocol = "tcp" | |
ports = ["5432"] | |
} | |
source_ranges = [google_datastream_private_connection.default.vpc_peering_config.0.subnet] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment