From 08b1dfdb8efcf1c59b69aae1c360f82abdec1e3f Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Mon, 10 Oct 2022 10:47:51 +0200 Subject: [PATCH] Fix optionals for resource_usage_export field in `gke-cluster` --- modules/gke-cluster/README.md | 30 +++++++++++++++--------------- modules/gke-cluster/variables.tf | 9 ++++----- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/modules/gke-cluster/README.md b/modules/gke-cluster/README.md index d2b2d9b900..f5a0dc0cfe 100644 --- a/modules/gke-cluster/README.md +++ b/modules/gke-cluster/README.md @@ -76,24 +76,24 @@ module "cluster-1" { | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [location](variables.tf#L118) | Cluster zone or region. | string | ✓ | | -| [name](variables.tf#L170) | Cluster name. | string | ✓ | | -| [project_id](variables.tf#L197) | Cluster project id. | string | ✓ | | -| [vpc_config](variables.tf#L208) | VPC-level configuration. | object({…}) | ✓ | | +| [location](variables.tf#L117) | Cluster zone or region. | string | ✓ | | +| [name](variables.tf#L169) | Cluster name. | string | ✓ | | +| [project_id](variables.tf#L196) | Cluster project id. | string | ✓ | | +| [vpc_config](variables.tf#L207) | VPC-level configuration. | object({…}) | ✓ | | | [cluster_autoscaling](variables.tf#L17) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | object({…}) | | null | | [description](variables.tf#L38) | Cluster description. | string | | null | | [enable_addons](variables.tf#L44) | Addons enabled in the cluster (true means enabled). | object({…}) | | {…} | -| [enable_features](variables.tf#L68) | Enable cluster-level features. Certain features allow configuration. | object({…}) | | {…} | -| [issue_client_certificate](variables.tf#L106) | Enable issuing client certificate. | bool | | false | -| [labels](variables.tf#L112) | Cluster resource labels. | map(string) | | null | -| [logging_config](variables.tf#L123) | Logging configuration. | list(string) | | ["SYSTEM_COMPONENTS"] | -| [maintenance_config](variables.tf#L129) | Maintenance window configuration. | object({…}) | | {…} | -| [max_pods_per_node](variables.tf#L152) | Maximum number of pods per node in this cluster. | number | | 110 | -| [min_master_version](variables.tf#L158) | Minimum version of the master, defaults to the version of the most recent official release. | string | | null | -| [monitoring_config](variables.tf#L164) | Monitoring components. | list(string) | | ["SYSTEM_COMPONENTS"] | -| [node_locations](variables.tf#L175) | Zones in which the cluster's nodes are located. | list(string) | | [] | -| [private_cluster_config](variables.tf#L182) | Private cluster configuration. | object({…}) | | null | -| [release_channel](variables.tf#L202) | Release channel for GKE upgrades. | string | | null | +| [enable_features](variables.tf#L68) | Enable cluster-level features. Certain features allow configuration. | object({…}) | | {…} | +| [issue_client_certificate](variables.tf#L105) | Enable issuing client certificate. | bool | | false | +| [labels](variables.tf#L111) | Cluster resource labels. | map(string) | | null | +| [logging_config](variables.tf#L122) | Logging configuration. | list(string) | | ["SYSTEM_COMPONENTS"] | +| [maintenance_config](variables.tf#L128) | Maintenance window configuration. | object({…}) | | {…} | +| [max_pods_per_node](variables.tf#L151) | Maximum number of pods per node in this cluster. | number | | 110 | +| [min_master_version](variables.tf#L157) | Minimum version of the master, defaults to the version of the most recent official release. | string | | null | +| [monitoring_config](variables.tf#L163) | Monitoring components. | list(string) | | ["SYSTEM_COMPONENTS"] | +| [node_locations](variables.tf#L174) | Zones in which the cluster's nodes are located. | list(string) | | [] | +| [private_cluster_config](variables.tf#L181) | Private cluster configuration. | object({…}) | | null | +| [release_channel](variables.tf#L201) | Release channel for GKE upgrades. | string | | null | ## Outputs diff --git a/modules/gke-cluster/variables.tf b/modules/gke-cluster/variables.tf index 97332266eb..52e64c84b9 100644 --- a/modules/gke-cluster/variables.tf +++ b/modules/gke-cluster/variables.tf @@ -85,9 +85,9 @@ variable "enable_features" { l4_ilb_subsetting = optional(bool, false) pod_security_policy = optional(bool, false) resource_usage_export = optional(object({ - dataset = optional(string) - enable_network_egress_metering = optional(bool, false) - enable_resource_consumption_metering = optional(bool, false) + dataset = string + enable_network_egress_metering = optional(bool) + enable_resource_consumption_metering = optional(bool) })) shielded_nodes = optional(bool, false) tpu = optional(bool, false) @@ -98,8 +98,7 @@ variable "enable_features" { workload_identity = optional(bool, false) }) default = { - workload_identity = true - resource_usage_export = null + workload_identity = true } }