diff --git a/docs/resources/google_container_regional_cluster.md b/docs/resources/google_container_regional_cluster.md index b8734ff6a..527c208f3 100644 --- a/docs/resources/google_container_regional_cluster.md +++ b/docs/resources/google_container_regional_cluster.md @@ -68,6 +68,18 @@ Properties that can be accessed from the `google_container_regional_cluster` res * `network`: The name of the Google Compute Engine network to which the cluster is connected. If left unspecified, the default network will be used. + * `private_cluster_config`: Configuration for a private cluster. + + * `enablePrivateNodes`: Whether nodes have internal IP addresses only. If enabled, all nodes are given only RFC 1918 private addresses and communicate with the master via private networking. + + * `enablePrivateEndpoint`: Whether the master's internal IP address is used as the cluster endpoint. + + * `masterIpv4CidrBlock`: The IP range in CIDR notation to use for the hosted master network. This range will be used for assigning internal IP addresses to the master or set of masters, as well as the ILB VIP. This range must not overlap with any other ranges in use within the cluster's network. + + * `privateEndpoint`: The internal IP address of this cluster's master endpoint. + + * `publicEndpoint`: The external IP address of this cluster's master endpoint. + * `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. * `addons_config`: Configurations for the various addons available to run in the cluster. diff --git a/docs/resources/google_container_regional_clusters.md b/docs/resources/google_container_regional_clusters.md index 6399a5378..52685ca3a 100644 --- a/docs/resources/google_container_regional_clusters.md +++ b/docs/resources/google_container_regional_clusters.md @@ -27,6 +27,7 @@ See [google_container_regional_cluster.md](google_container_regional_cluster.md) * `logging_services`: an array of `google_container_regional_cluster` logging_service * `monitoring_services`: an array of `google_container_regional_cluster` monitoring_service * `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 * `addons_configs`: an array of `google_container_regional_cluster` addons_config * `subnetworks`: an array of `google_container_regional_cluster` subnetwork diff --git a/libraries/google/container/property/regionalcluster_private_cluster_config.rb b/libraries/google/container/property/regionalcluster_private_cluster_config.rb new file mode 100644 index 000000000..09476fd30 --- /dev/null +++ b/libraries/google/container/property/regionalcluster_private_cluster_config.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: false + +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- +module GoogleInSpec + module Container + module Property + class RegionalClusterPrivateClusterConfig + attr_reader :enable_private_nodes + + attr_reader :enable_private_endpoint + + attr_reader :master_ipv4_cidr_block + + attr_reader :private_endpoint + + attr_reader :public_endpoint + + def initialize(args = nil) + return if args.nil? + @enable_private_nodes = args['enablePrivateNodes'] + @enable_private_endpoint = args['enablePrivateEndpoint'] + @master_ipv4_cidr_block = args['masterIpv4CidrBlock'] + @private_endpoint = args['privateEndpoint'] + @public_endpoint = args['publicEndpoint'] + end + end + end + end +end diff --git a/libraries/google_container_regional_cluster.rb b/libraries/google_container_regional_cluster.rb index 04942518a..2d69510b1 100644 --- a/libraries/google_container_regional_cluster.rb +++ b/libraries/google_container_regional_cluster.rb @@ -19,6 +19,7 @@ require 'google/container/property/regionalcluster_addons_config_http_load_balancing' require 'google/container/property/regionalcluster_master_auth' require 'google/container/property/regionalcluster_node_config' +require 'google/container/property/regionalcluster_private_cluster_config' # A provider to manage Google Kubernetes Engine resources. class RegionalCluster < GcpResourceBase @@ -34,6 +35,7 @@ class RegionalCluster < GcpResourceBase attr_reader :logging_service attr_reader :monitoring_service attr_reader :network + attr_reader :private_cluster_config attr_reader :cluster_ipv4_cidr attr_reader :addons_config attr_reader :subnetwork @@ -63,6 +65,7 @@ def parse @logging_service = @fetched['loggingService'] @monitoring_service = @fetched['monitoringService'] @network = @fetched['network'] + @private_cluster_config = GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(@fetched['privateClusterConfig']) @cluster_ipv4_cidr = @fetched['clusterIpv4Cidr'] @addons_config = GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(@fetched['addonsConfig']) @subnetwork = @fetched['subnetwork'] diff --git a/libraries/google_container_regional_clusters.rb b/libraries/google_container_regional_clusters.rb index f4dc5cf66..2297f3040 100644 --- a/libraries/google_container_regional_clusters.rb +++ b/libraries/google_container_regional_clusters.rb @@ -31,6 +31,7 @@ class RegionalClusters < GcpResourceBase filter_table_config.add(:logging_services, field: :logging_service) filter_table_config.add(:monitoring_services, field: :monitoring_service) 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(:addons_configs, field: :addons_config) filter_table_config.add(:subnetworks, field: :subnetwork) @@ -91,6 +92,7 @@ def transformers 'loggingService' => ->(obj) { return :logging_service, obj['loggingService'] }, 'monitoringService' => ->(obj) { return :monitoring_service, obj['monitoringService'] }, 'network' => ->(obj) { return :network, obj['network'] }, + 'privateClusterConfig' => ->(obj) { return :private_cluster_config, GoogleInSpec::Container::Property::RegionalClusterPrivateClusterConfig.new(obj['privateClusterConfig']) }, 'clusterIpv4Cidr' => ->(obj) { return :cluster_ipv4_cidr, obj['clusterIpv4Cidr'] }, 'addonsConfig' => ->(obj) { return :addons_config, GoogleInSpec::Container::Property::RegionalClusterAddonsConfig.new(obj['addonsConfig']) }, 'subnetwork' => ->(obj) { return :subnetwork, obj['subnetwork'] },