Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform/gcp: Do not create unused subnetworks and Upgrade to latest google provider #8497

Merged
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
2 changes: 1 addition & 1 deletion contrib/terraform/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.48"
version = "~> 4.0"
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions contrib/terraform/gcp/modules/kubernetes-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

resource "google_compute_network" "main" {
name = "${var.prefix}-network"

auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "main" {
Expand All @@ -20,6 +22,8 @@ resource "google_compute_firewall" "deny_all" {

priority = 1000

source_ranges = ["0.0.0.0/0"]

deny {
protocol = "all"
}
Expand Down Expand Up @@ -86,6 +90,8 @@ resource "google_compute_firewall" "ingress_http" {

priority = 100

source_ranges = ["0.0.0.0/0"]

allow {
protocol = "tcp"
ports = ["80"]
Expand All @@ -98,6 +104,8 @@ resource "google_compute_firewall" "ingress_https" {

priority = 100

source_ranges = ["0.0.0.0/0"]

allow {
protocol = "tcp"
ports = ["443"]
Expand Down