Skip to content

Commit 19a9e9c

Browse files
authored
feat: Add variable disable_default_snat (terraform-google-modules#625)
1 parent 3900061 commit 19a9e9c

File tree

43 files changed

+101
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+101
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.12.0
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

autogen/main/cluster.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ resource "google_container_cluster" "primary" {
5757

5858
subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
5959

60+
{% if beta_cluster %}
61+
default_snat_status{
62+
disabled = var.disable_default_snat
63+
}
64+
{% endif %}
6065
{% if beta_cluster %}
6166
min_master_version = var.release_channel != null ? null : local.master_version
6267
{% else %}

autogen/main/variables.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,11 @@ variable "gcloud_skip_download" {
550550
description = "Whether to skip downloading gcloud (assumes gcloud is already available outside the module)"
551551
default = true
552552
}
553+
554+
{% if beta_cluster %}
555+
variable "disable_default_snat" {
556+
type = bool
557+
description = "Whether to disable the default SNAT to support the private use of public IP addresses"
558+
default = false
559+
}
560+
{% endif %}

autogen/main/versions.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ terraform {
1919

2020
required_providers {
2121
{% if beta_cluster %}
22-
google-beta = ">= 3.29.0, <4.0.0"
22+
google-beta = ">= 3.32.0, <4.0.0"
2323
{% else %}
2424
google = ">= 3.16, <4.0.0"
2525
{% endif %}

autogen/safer-cluster/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ module "gke" {
4949
ip_range_pods = var.ip_range_pods
5050
ip_range_services = var.ip_range_services
5151

52+
disable_default_snat = var.disable_default_snat
53+
5254
add_cluster_firewall_rules = var.add_cluster_firewall_rules
5355
firewall_priority = var.firewall_priority
5456
firewall_inbound_ports = var.firewall_inbound_ports

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,9 @@ variable "config_connector" {
363363
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
364364
default = false
365365
}
366+
367+
variable "disable_default_snat" {
368+
type = bool
369+
description = "Whether to disable the default SNAT to support the private use of public IP addresses"
370+
default = false
371+
}

build/int.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,6 @@ tags:
429429
- 'integration'
430430
substitutions:
431431
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
432-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0'
432+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.12.0'
433433
options:
434434
machineType: 'N1_HIGHCPU_8'

build/lint.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ tags:
2222
- 'lint'
2323
substitutions:
2424
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
25-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0'
25+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.12.0'

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.29.0"
22+
version = "~> 3.32.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.29.0"
22+
version = "~> 3.32.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

0 commit comments

Comments
 (0)