diff --git a/docs/resources/google_container_regional_cluster.md b/docs/resources/google_container_regional_cluster.md index 26d6975f0..40c7a59ef 100644 --- a/docs/resources/google_container_regional_cluster.md +++ b/docs/resources/google_container_regional_cluster.md @@ -105,6 +105,10 @@ Properties that can be accessed from the `google_container_regional_cluster` res * `cluster_ipv4_cidr`: The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8. + * `enable_tpu`: (Optional) Whether to enable Cloud TPU resources in this cluster. See the official documentation - https://cloud.google.com/tpu/docs/kubernetes-engine-setup + + * `tpu_ipv4_cidr_block`: The IP address range of the Cloud TPUs in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). + * `addons_config`: Configurations for the various addons available to run in the cluster. * `http_load_balancing`: Configuration for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. @@ -187,10 +191,6 @@ Properties that can be accessed from the `google_container_regional_cluster` res * `expire_time`: The time the cluster will be automatically deleted in RFC3339 text format. - * `enable_tpu`: Enable the ability to use Cloud TPUs in this cluster. - - * `tpu_ipv4_cidr_block`: The IP address range of the Cloud TPUs in this cluster, in CIDR notation - * `conditions`: Which conditions caused the current cluster state. * `code`: Machine-friendly representation of the condition diff --git a/docs/resources/google_container_regional_clusters.md b/docs/resources/google_container_regional_clusters.md index 3917f4432..027d18563 100644 --- a/docs/resources/google_container_regional_clusters.md +++ b/docs/resources/google_container_regional_clusters.md @@ -29,6 +29,8 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md) * `networks`: an array of `google_container_regional_cluster` network * `private_cluster_configs`: an array of `google_container_regional_cluster` private_cluster_config * `cluster_ipv4_cidrs`: an array of `google_container_regional_cluster` cluster_ipv4_cidr + * `enable_tpus`: an array of `google_container_regional_cluster` enable_tpu + * `tpu_ipv4_cidr_blocks`: an array of `google_container_regional_cluster` tpu_ipv4_cidr_block * `addons_configs`: an array of `google_container_regional_cluster` addons_config * `subnetworks`: an array of `google_container_regional_cluster` subnetwork * `locations`: an array of `google_container_regional_cluster` locations @@ -49,8 +51,6 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md) * `services_ipv4_cidrs`: an array of `google_container_regional_cluster` services_ipv4_cidr * `current_node_counts`: an array of `google_container_regional_cluster` current_node_count * `expire_times`: an array of `google_container_regional_cluster` expire_time - * `enable_tpus`: an array of `google_container_regional_cluster` enable_tpu - * `tpu_ipv4_cidr_blocks`: an array of `google_container_regional_cluster` tpu_ipv4_cidr_block * `conditions`: an array of `google_container_regional_cluster` conditions * `master_authorized_networks_configs`: an array of `google_container_regional_cluster` master_authorized_networks_config * `locations`: an array of `google_container_regional_cluster` location diff --git a/libraries/google_container_regional_cluster.rb b/libraries/google_container_regional_cluster.rb index f6edafbd5..ec3f4b0e0 100644 --- a/libraries/google_container_regional_cluster.rb +++ b/libraries/google_container_regional_cluster.rb @@ -50,6 +50,8 @@ class ContainerRegionalCluster < GcpResourceBase attr_reader :network attr_reader :private_cluster_config attr_reader :cluster_ipv4_cidr + attr_reader :enable_tpu + attr_reader :tpu_ipv4_cidr_block attr_reader :addons_config attr_reader :subnetwork attr_reader :locations @@ -70,8 +72,6 @@ class ContainerRegionalCluster < GcpResourceBase attr_reader :services_ipv4_cidr attr_reader :current_node_count attr_reader :expire_time - attr_reader :enable_tpu - attr_reader :tpu_ipv4_cidr_block attr_reader :conditions attr_reader :master_authorized_networks_config attr_reader :location @@ -94,6 +94,8 @@ def parse @network = @fetched['network'] @private_cluster_config = GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(@fetched['privateClusterConfig'], to_s) @cluster_ipv4_cidr = @fetched['clusterIpv4Cidr'] + @enable_tpu = @fetched['enableTpu'] + @tpu_ipv4_cidr_block = @fetched['tpuIpv4CidrBlock'] @addons_config = GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(@fetched['addonsConfig'], to_s) @subnetwork = @fetched['subnetwork'] @locations = @fetched['locations'] @@ -114,8 +116,6 @@ def parse @services_ipv4_cidr = @fetched['servicesIpv4Cidr'] @current_node_count = @fetched['currentNodeCount'] @expire_time = parse_time_string(@fetched['expireTime']) - @enable_tpu = @fetched['enableTpu'] - @tpu_ipv4_cidr_block = @fetched['tpuIpv4CidrBlock'] @conditions = GoogleInSpec::Container::Property::RegionalClusterConditionsArray.parse(@fetched['conditions'], to_s) @master_authorized_networks_config = GoogleInSpec::Container::Property::RegionalClusterMasterAuthorizedNetworksConfig.new(@fetched['masterAuthorizedNetworksConfig'], to_s) @location = @fetched['location'] diff --git a/libraries/google_container_regional_clusters.rb b/libraries/google_container_regional_clusters.rb index 9aabb0b4c..e0625da7c 100644 --- a/libraries/google_container_regional_clusters.rb +++ b/libraries/google_container_regional_clusters.rb @@ -33,6 +33,8 @@ class ContainerRegionalClusters < GcpResourceBase filter_table_config.add(:networks, field: :network) filter_table_config.add(:private_cluster_configs, field: :private_cluster_config) filter_table_config.add(:cluster_ipv4_cidrs, field: :cluster_ipv4_cidr) + filter_table_config.add(:enable_tpus, field: :enable_tpu) + filter_table_config.add(:tpu_ipv4_cidr_blocks, field: :tpu_ipv4_cidr_block) filter_table_config.add(:addons_configs, field: :addons_config) filter_table_config.add(:subnetworks, field: :subnetwork) filter_table_config.add(:locations, field: :locations) @@ -53,8 +55,6 @@ class ContainerRegionalClusters < GcpResourceBase filter_table_config.add(:services_ipv4_cidrs, field: :services_ipv4_cidr) filter_table_config.add(:current_node_counts, field: :current_node_count) filter_table_config.add(:expire_times, field: :expire_time) - filter_table_config.add(:enable_tpus, field: :enable_tpu) - filter_table_config.add(:tpu_ipv4_cidr_blocks, field: :tpu_ipv4_cidr_block) filter_table_config.add(:conditions, field: :conditions) filter_table_config.add(:master_authorized_networks_configs, field: :master_authorized_networks_config) filter_table_config.add(:locations, field: :location) @@ -107,6 +107,8 @@ def transformers 'network' => ->(obj) { return :network, obj['network'] }, 'privateClusterConfig' => ->(obj) { return :private_cluster_config, GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(obj['privateClusterConfig'], to_s) }, 'clusterIpv4Cidr' => ->(obj) { return :cluster_ipv4_cidr, obj['clusterIpv4Cidr'] }, + 'enableTpu' => ->(obj) { return :enable_tpu, obj['enableTpu'] }, + 'tpuIpv4CidrBlock' => ->(obj) { return :tpu_ipv4_cidr_block, obj['tpuIpv4CidrBlock'] }, 'addonsConfig' => ->(obj) { return :addons_config, GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(obj['addonsConfig'], to_s) }, 'subnetwork' => ->(obj) { return :subnetwork, obj['subnetwork'] }, 'locations' => ->(obj) { return :locations, obj['locations'] }, @@ -127,8 +129,6 @@ def transformers 'servicesIpv4Cidr' => ->(obj) { return :services_ipv4_cidr, obj['servicesIpv4Cidr'] }, 'currentNodeCount' => ->(obj) { return :current_node_count, obj['currentNodeCount'] }, 'expireTime' => ->(obj) { return :expire_time, parse_time_string(obj['expireTime']) }, - 'enableTpu' => ->(obj) { return :enable_tpu, obj['enableTpu'] }, - 'tpuIpv4CidrBlock' => ->(obj) { return :tpu_ipv4_cidr_block, obj['tpuIpv4CidrBlock'] }, 'conditions' => ->(obj) { return :conditions, GoogleInSpec::Container::Property::RegionalClusterConditionsArray.parse(obj['conditions'], to_s) }, 'masterAuthorizedNetworksConfig' => ->(obj) { return :master_authorized_networks_config, GoogleInSpec::Container::Property::RegionalClusterMasterAuthorizedNetworksConfig.new(obj['masterAuthorizedNetworksConfig'], to_s) }, 'location' => ->(obj) { return :location, obj['location'] },