No public IPs for GCP instances

This commit is contained in:
katexochen 2022-09-27 12:44:45 +02:00 committed by Paul Meyer
parent ccbc3d9123
commit 9a96f2ffe1
2 changed files with 13 additions and 1 deletions

View File

@ -58,6 +58,19 @@ resource "google_compute_subnetwork" "vpc_subnetwork" {
]
}
resource "google_compute_router" "vpc_router" {
name = local.name
description = "Constellation VPC router"
network = google_compute_network.vpc_network.id
}
resource "google_compute_router_nat" "vpc_router_nat" {
name = local.name
router = google_compute_router.vpc_router.name
nat_ip_allocate_option = "AUTO_ONLY"
source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"
}
resource "google_compute_firewall" "firewall_external" {
name = local.name
description = "Constellation VPC firewall"

View File

@ -48,7 +48,6 @@ resource "google_compute_instance_template" "template" {
network_interface {
network = var.network
subnetwork = var.subnetwork
access_config {}
alias_ip_range {
ip_cidr_range = "/24"
subnetwork_range_name = var.name