Skip to content

Commit

Permalink
Regenerate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-lane committed Jun 26, 2019
1 parent a9613ef commit 2c38f12
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 80 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ To more cleanly handle cases where desired functionality would require complex d

The root module is generated by running `make generate`. Changes to this repository should be made in the [`autogen`](/autogen) directory where appropriate.

Note: The correct sequence to update the repo using autogen
functionality is the run `make generate && make generate_docs`. This
will create the various Terraform files, and then generate the
Terraform documentation using `terraform-docs`.

## Testing

### Requirements
Expand Down
7 changes: 4 additions & 3 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "primary" {
description = "${var.description}"
project = "${var.project_id}"

region = "${var.region}"
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
region = "${var.region}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -100,6 +100,7 @@ resource "google_container_cluster" "primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

Expand Down
7 changes: 4 additions & 3 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "zonal_primary" {
description = "${var.description}"
project = "${var.project_id}"

zone = "${var.zones[0]}"
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
zone = "${var.zones[0]}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -100,6 +100,7 @@ resource "google_container_cluster" "zonal_primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
}

Expand Down
25 changes: 12 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,18 @@ locals {
cluster_master_auth_map = "${local.cluster_master_auth_list_layer2[0]}"

# cluster locals
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"

cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_network_policy_enabled = "${local.cluster_type_output_network_policy_enabled[local.cluster_type] ? false : true}"
cluster_http_load_balancing_enabled = "${local.cluster_type_output_http_load_balancing_enabled[local.cluster_type] ? false : true}"
cluster_horizontal_pod_autoscaling_enabled = "${local.cluster_type_output_horizontal_pod_autoscaling_enabled[local.cluster_type] ? false : true}"
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ To more cleanly handle cases where desired functionality would require complex d

The root module is generated by running `make generate`. Changes to this repository should be made in the [`autogen`](/autogen) directory where appropriate.

Note: The correct sequence to update the repo using autogen
functionality is the run `make generate && make generate_docs`. This
will create the various Terraform files, and then generate the
Terraform documentation using `terraform-docs`.

## Testing

### Requirements
Expand Down
9 changes: 6 additions & 3 deletions modules/beta-private-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "primary" {
description = "${var.description}"
project = "${var.project_id}"

region = "${var.region}"
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
region = "${var.region}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -71,6 +71,7 @@ resource "google_container_cluster" "primary" {
network_policy_config {
disabled = "${var.network_policy ? 0 : 1}"
}

istio_config {
disabled = "${var.istio ? 0 : 1}"
}
Expand Down Expand Up @@ -109,11 +110,13 @@ resource "google_container_cluster" "primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}

remove_default_node_pool = "${var.remove_default_node_pool}"
database_encryption = ["${var.database_encryption}"]
}
Expand Down
9 changes: 6 additions & 3 deletions modules/beta-private-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "zonal_primary" {
description = "${var.description}"
project = "${var.project_id}"

zone = "${var.zones[0]}"
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
zone = "${var.zones[0]}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -71,6 +71,7 @@ resource "google_container_cluster" "zonal_primary" {
network_policy_config {
disabled = "${var.network_policy ? 0 : 1}"
}

istio_config {
disabled = "${var.istio ? 0 : 1}"
}
Expand Down Expand Up @@ -109,11 +110,13 @@ resource "google_container_cluster" "zonal_primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

private_cluster_config {
enable_private_endpoint = "${var.enable_private_endpoint}"
enable_private_nodes = "${var.enable_private_nodes}"
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
}

remove_default_node_pool = "${var.remove_default_node_pool}"
database_encryption = ["${var.database_encryption}"]
}
Expand Down
24 changes: 12 additions & 12 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ locals {
cluster_master_auth_list_layer2 = "${local.cluster_master_auth_list_layer1[0]}"
cluster_master_auth_map = "${local.cluster_master_auth_list_layer2[0]}"
# cluster locals
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_network_policy_enabled = "${local.cluster_type_output_network_policy_enabled[local.cluster_type] ? false : true}"
cluster_http_load_balancing_enabled = "${local.cluster_type_output_http_load_balancing_enabled[local.cluster_type] ? false : true}"
cluster_horizontal_pod_autoscaling_enabled = "${local.cluster_type_output_horizontal_pod_autoscaling_enabled[local.cluster_type] ? false : true}"
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ To more cleanly handle cases where desired functionality would require complex d

The root module is generated by running `make generate`. Changes to this repository should be made in the [`autogen`](/autogen) directory where appropriate.

Note: The correct sequence to update the repo using autogen
functionality is the run `make generate && make generate_docs`. This
will create the various Terraform files, and then generate the
Terraform documentation using `terraform-docs`.

## Testing

### Requirements
Expand Down
8 changes: 5 additions & 3 deletions modules/beta-public-cluster/cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "primary" {
description = "${var.description}"
project = "${var.project_id}"

region = "${var.region}"
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
region = "${var.region}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -69,6 +69,7 @@ resource "google_container_cluster" "primary" {
network_policy_config {
disabled = "${var.network_policy ? 0 : 1}"
}

istio_config {
disabled = "${var.istio ? 0 : 1}"
}
Expand Down Expand Up @@ -107,6 +108,7 @@ resource "google_container_cluster" "primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
database_encryption = ["${var.database_encryption}"]
}
Expand Down
8 changes: 5 additions & 3 deletions modules/beta-public-cluster/cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resource "google_container_cluster" "zonal_primary" {
description = "${var.description}"
project = "${var.project_id}"

zone = "${var.zones[0]}"
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
zone = "${var.zones[0]}"
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 = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

network_policy {
enabled = "${var.network_policy}"
Expand Down Expand Up @@ -69,6 +69,7 @@ resource "google_container_cluster" "zonal_primary" {
network_policy_config {
disabled = "${var.network_policy ? 0 : 1}"
}

istio_config {
disabled = "${var.istio ? 0 : 1}"
}
Expand Down Expand Up @@ -107,6 +108,7 @@ resource "google_container_cluster" "zonal_primary" {
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
}
}

remove_default_node_pool = "${var.remove_default_node_pool}"
database_encryption = ["${var.database_encryption}"]
}
Expand Down
24 changes: 12 additions & 12 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,18 @@ locals {
cluster_master_auth_list_layer2 = "${local.cluster_master_auth_list_layer1[0]}"
cluster_master_auth_map = "${local.cluster_master_auth_list_layer2[0]}"
# cluster locals
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_logging_service = "${local.cluster_type_output_logging_service[local.cluster_type]}"
cluster_monitoring_service = "${local.cluster_type_output_monitoring_service[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_network_policy_enabled = "${local.cluster_type_output_network_policy_enabled[local.cluster_type] ? false : true}"
cluster_http_load_balancing_enabled = "${local.cluster_type_output_http_load_balancing_enabled[local.cluster_type] ? false : true}"
cluster_horizontal_pod_autoscaling_enabled = "${local.cluster_type_output_horizontal_pod_autoscaling_enabled[local.cluster_type] ? false : true}"
Expand Down
1 change: 0 additions & 1 deletion modules/beta-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,3 @@ output "cloudrun_enabled" {
description = "Whether CloudRun enabled"
value = "${local.cluster_cloudrun_enabled}"
}

5 changes: 5 additions & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ To more cleanly handle cases where desired functionality would require complex d

The root module is generated by running `make generate`. Changes to this repository should be made in the [`autogen`](/autogen) directory where appropriate.

Note: The correct sequence to update the repo using autogen
functionality is the run `make generate && make generate_docs`. This
will create the various Terraform files, and then generate the
Terraform documentation using `terraform-docs`.

## Testing

### Requirements
Expand Down
Loading

0 comments on commit 2c38f12

Please sign in to comment.