Skip to content

Commit

Permalink
Regenerate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-lane committed Jul 2, 2019
1 parent ccdc1d3 commit 9a40468
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 64 deletions.
6 changes: 1 addition & 5 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "primary" {
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_regional}"
Expand Down
6 changes: 1 addition & 5 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "zonal_primary" {
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_zonal}"
Expand Down
19 changes: 19 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ locals {

cluster_type = "${var.regional ? "regional" : "zonal"}"

cluster_network_policy = {
enabled = [{
enabled = "true"
provider = "${var.network_policy_provider}"
}]

disabled = [{
enabled = "false"
}]
}

cluster_cloudrun_config = {
enabled = [{
disabled = "false"
}]

disabled = []
}

cluster_type_output_name = {
regional = "${element(concat(google_container_cluster.primary.*.name, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.name, list("")), 0)}"
Expand Down
10 changes: 2 additions & 8 deletions modules/beta-private-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "primary" {
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_regional}"
Expand Down Expand Up @@ -76,9 +72,7 @@ resource "google_container_cluster" "primary" {
disabled = "${var.istio ? 0 : 1}"
}

cloudrun_config {
disabled = "${var.cloudrun ? 0 : 1}"
}
cloudrun_config = "${local.cluster_cloudrun_config["${var.cloudrun ? "enabled" : "disabled"}"]}"
}

ip_allocation_policy {
Expand Down
10 changes: 2 additions & 8 deletions modules/beta-private-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "zonal_primary" {
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_zonal}"
Expand Down Expand Up @@ -77,9 +73,7 @@ resource "google_container_cluster" "zonal_primary" {
disabled = "${var.istio ? 0 : 1}"
}

cloudrun_config {
disabled = "${var.cloudrun ? 0 : 1}"
}
cloudrun_config = "${local.cluster_cloudrun_config["${var.cloudrun ? "enabled" : "disabled"}"]}"
}

ip_allocation_policy {
Expand Down
26 changes: 20 additions & 6 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ locals {

cluster_type = "${var.regional ? "regional" : "zonal"}"

cluster_network_policy = {
enabled = [{
enabled = "true"
provider = "${var.network_policy_provider}"
}]

disabled = [{
enabled = "false"
}]
}

cluster_cloudrun_config = {
enabled = [{
disabled = "false"
}]

disabled = []
}

cluster_type_output_name = {
regional = "${element(concat(google_container_cluster.primary.*.name, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.name, list("")), 0)}"
Expand Down Expand Up @@ -128,11 +147,6 @@ locals {
zonal = "${element(concat(google_container_cluster.zonal_primary.*.addons_config.0.istio_config.0.disabled, list("")), 0)}"
}

cluster_type_output_cloudrun_enabled = {
regional = "${element(concat(google_container_cluster.primary.*.addons_config.0.cloudrun_config.0.disabled, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.addons_config.0.cloudrun_config.0.disabled, list("")), 0)}"
}

cluster_type_output_pod_security_policy_enabled = {
regional = "${element(concat(google_container_cluster.primary.*.pod_security_policy_config.0.enabled, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.pod_security_policy_config.0.enabled, list("")), 0)}"
Expand Down Expand Up @@ -170,7 +184,7 @@ locals {
cluster_kubernetes_dashboard_enabled = "${local.cluster_type_output_kubernetes_dashboard_enabled[local.cluster_type] ? false : true}"
# BETA features
cluster_istio_enabled = "${local.cluster_type_output_istio_enabled[local.cluster_type] ? false : true}"
cluster_cloudrun_enabled = "${local.cluster_type_output_cloudrun_enabled[local.cluster_type] ? false : true}"
cluster_cloudrun_enabled = "${var.cloudrun}"
cluster_pod_security_policy_enabled = "${local.cluster_type_output_pod_security_policy_enabled[local.cluster_type] ? true : false}"

# /BETA features
Expand Down
10 changes: 2 additions & 8 deletions modules/beta-public-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "primary" {
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_regional}"
Expand Down Expand Up @@ -76,9 +72,7 @@ resource "google_container_cluster" "primary" {
disabled = "${var.istio ? 0 : 1}"
}

cloudrun_config {
disabled = "${var.cloudrun ? 0 : 1}"
}
cloudrun_config = "${local.cluster_cloudrun_config["${var.cloudrun ? "enabled" : "disabled"}"]}"
}

ip_allocation_policy {
Expand Down
10 changes: 2 additions & 8 deletions modules/beta-public-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "zonal_primary" {
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_zonal}"
Expand Down Expand Up @@ -77,9 +73,7 @@ resource "google_container_cluster" "zonal_primary" {
disabled = "${var.istio ? 0 : 1}"
}

cloudrun_config {
disabled = "${var.cloudrun ? 0 : 1}"
}
cloudrun_config = "${local.cluster_cloudrun_config["${var.cloudrun ? "enabled" : "disabled"}"]}"
}

ip_allocation_policy {
Expand Down
26 changes: 20 additions & 6 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ locals {

cluster_type = "${var.regional ? "regional" : "zonal"}"

cluster_network_policy = {
enabled = [{
enabled = "true"
provider = "${var.network_policy_provider}"
}]

disabled = [{
enabled = "false"
}]
}

cluster_cloudrun_config = {
enabled = [{
disabled = "false"
}]

disabled = []
}

cluster_type_output_name = {
regional = "${element(concat(google_container_cluster.primary.*.name, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.name, list("")), 0)}"
Expand Down Expand Up @@ -119,11 +138,6 @@ locals {
zonal = "${element(concat(google_container_cluster.zonal_primary.*.addons_config.0.istio_config.0.disabled, list("")), 0)}"
}

cluster_type_output_cloudrun_enabled = {
regional = "${element(concat(google_container_cluster.primary.*.addons_config.0.cloudrun_config.0.disabled, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.addons_config.0.cloudrun_config.0.disabled, list("")), 0)}"
}

cluster_type_output_pod_security_policy_enabled = {
regional = "${element(concat(google_container_cluster.primary.*.pod_security_policy_config.0.enabled, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.pod_security_policy_config.0.enabled, list("")), 0)}"
Expand Down Expand Up @@ -161,7 +175,7 @@ locals {
cluster_kubernetes_dashboard_enabled = "${local.cluster_type_output_kubernetes_dashboard_enabled[local.cluster_type] ? false : true}"
# BETA features
cluster_istio_enabled = "${local.cluster_type_output_istio_enabled[local.cluster_type] ? false : true}"
cluster_cloudrun_enabled = "${local.cluster_type_output_cloudrun_enabled[local.cluster_type] ? false : true}"
cluster_cloudrun_enabled = "${var.cloudrun}"
cluster_pod_security_policy_enabled = "${local.cluster_type_output_pod_security_policy_enabled[local.cluster_type] ? true : false}"

# /BETA features
Expand Down
6 changes: 1 addition & 5 deletions modules/private-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "primary" {
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_regional}"
Expand Down
6 changes: 1 addition & 5 deletions modules/private-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ resource "google_container_cluster" "zonal_primary" {
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
cluster_ipv4_cidr = "${var.cluster_ipv4_cidr}"
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
provider = "${var.network_policy_provider}"
}
network_policy = "${local.cluster_network_policy["${var.network_policy ? "enabled" : "disabled"}"]}"

subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
min_master_version = "${local.kubernetes_version_zonal}"
Expand Down
19 changes: 19 additions & 0 deletions modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ locals {

cluster_type = "${var.regional ? "regional" : "zonal"}"

cluster_network_policy = {
enabled = [{
enabled = "true"
provider = "${var.network_policy_provider}"
}]

disabled = [{
enabled = "false"
}]
}

cluster_cloudrun_config = {
enabled = [{
disabled = "false"
}]

disabled = []
}

cluster_type_output_name = {
regional = "${element(concat(google_container_cluster.primary.*.name, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.name, list("")), 0)}"
Expand Down

0 comments on commit 9a40468

Please sign in to comment.