Project: Chef InSpec (Provisioning / Security & Compliance)
File: google_container_clusters.md

+++ title = "googlecontainerclusters resource" draft = false gh_repo = "inspec" platform = "gcp" [menu] [menu.inspec] title = "googlecontainerclusters" identifier = "inspec/resources/gcp/googlecontainerclusters.md googlecontainerclusters resource" parent = "inspec/resources/gcp" +++ A `googlecontainerclusters` is used to test a Google Cluster resource. This resource has beta fields available. To retrieve these fields, include `beta: true` in the constructor for the resource. ```ruby describe googlecontainerclusters(project: 'chef-gcp-inspec', location: 'europe-west2-a') do its('cluster_names') { should include 'gcp-inspec-kube-cluster' } end ``` describe googlecontainerclusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do its('count') { should be <= 5} end describe googlecontainerclusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do its('cluster_names') { should include "my-cluster" } end describe googlecontainerclusters(project: 'chef-inspec-gcp', location: 'europe-west2-a') do its('clusterstatuses') { shouldnot include "STOPPING" } end googlecontainerclusters(project: gcpprojectid).where(clustername: /^kube/).clusternames.each do |cluster_name| describe googlecontainercluster(project: 'chef-inspec-gcp', location: 'europe-west2-a', name: cluster_name) do it { should exist } its('status') { should eq 'RUNNING' } end end Properties that can be accessed from the `googlecontainerclusters` resource: See the resource for more information. `cluster_names` : an array of `googlecontainercluster` name `descriptions` : an array of `googlecontainercluster` description `initialnodecounts` : an array of `googlecontainercluster` initialnodecount `node_configs` : an array of `googlecontainercluster` node_config `master_auths` : an array of `googlecontainercluster` master_auth `logging_services` : an array of `googlecontainercluster` logging_service `monitoring_services` : an array of `googlecontainercluster` monitoring_service `cluster_networks` : an array of `googlecontainercluster` network `privateclusterconfigs` : an array of `googlecontainercluster` privateclusterconfig `clusteripv4cidrs` : an array of `googlecontainercluster` clusteripv4cidr `enable_tpus` : an array of `googlecontainercluster` enable_tpu `tpuipv4cidr_blocks` : an array of `googlecontainercluster` tpuipv4cidr_block `addons_configs` : an array of `googlecontainercluster` addons_config `subnetworks` : an array of `googlecontainercluster` subnetwork `locations` : an array of `googlecontainercluster` locations `resource_labels` : an array of `googlecontainercluster` resource_labels `label_fingerprints` : an array of `googlecontainercluster` label_fingerprint `legacy_abacs` : an array of `googlecontainercluster` legacy_abac `network_policies` : an array of `googlecontainercluster` network_policy `defaultmaxpods_constraints` : an array of `googlecontainercluster` defaultmaxpods_constraint `ipallocationpolicies` : an array of `googlecontainercluster` ipallocationpolicy `endpoints` : an array of `googlecontainercluster` endpoint `initialclusterversions` : an array of `googlecontainercluster` initialclusterversion `currentmasterversions` : an array of `googlecontainercluster` currentmasterversion `currentnodeversions` : an array of `googlecontainercluster` currentnodeversion `create_times` : an array of `googlecontainercluster` create_time `cluster_statuses` : an array of `googlecontainercluster` status `status_messages` : an array of `googlecontainercluster` status_message `nodeipv4cidr_sizes` : an array of `googlecontainercluster` nodeipv4cidr_size `servicesipv4cidrs` : an array of `googlecontainercluster` servicesipv4cidr `currentnodecounts` : an array of `googlecontainercluster` currentnodecount `expire_times` : an array of `googlecontainercluster` expire_time `conditions` : an array of `googlecontainercluster` conditions `masterauthorizednetworks_configs` : an array of `googlecontainercluster` masterauthorizednetworks_config `node_pools` : an array of `googlecontainercluster` node_pools `podsecuritypolicy_configs` : (Beta only) an array of `googlecontainercluster` podsecuritypolicy_config `binary_authorizations` : an array of `googlecontainercluster` binary_authorization `locations` : an array of `googlecontainercluster` location This resource supports all of the above properties as filter criteria, which can be used with `where` as a block or a method. Ensure the is enabled for the current project.