Skip to content

Instantly share code, notes, and snippets.

@marvinhoxha
Created October 12, 2022 14:40
Show Gist options
  • Save marvinhoxha/96a67c6adaea7f95bc2d27cab25e96aa to your computer and use it in GitHub Desktop.
Save marvinhoxha/96a67c6adaea7f95bc2d27cab25e96aa to your computer and use it in GitHub Desktop.
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