title | platform |
---|---|
About the google_compute_instances resource |
gcp |
A google_compute_instances
is used to test a Google Instance resource
This resource has beta fields available. To retrieve these fields, include beta: true
in the constructor for the resource
describe google_compute_instances(project: 'chef-gcp-inspec', zone: 'zone') do
its('instance_names') { should include 'inspec-instance' }
end
describe google_compute_instances(project: 'chef-inspec-gcp', zone: 'europe-west2-a') do
its('count') { should be <= 100}
end
describe google_compute_instances(project: 'chef-inspec-gcp', zone: 'europe-west2-a') do
its('instance_ids.count') { should cmp 9 }
end
describe google_compute_instances(project: 'chef-inspec-gcp', zone: 'europe-west2-a') do
its('instance_names') { should include "my-favourite-instance" }
end
Properties that can be accessed from the google_compute_instances
resource:
See google_compute_instance.md for more detailed information
can_ip_forwards
: an array ofgoogle_compute_instance
can_ip_forwardcpu_platforms
: an array ofgoogle_compute_instance
cpu_platformcreation_timestamps
: an array ofgoogle_compute_instance
creation_timestampdeletion_protections
: an array ofgoogle_compute_instance
deletion_protectiondisks
: an array ofgoogle_compute_instance
disksguest_accelerators
: an array ofgoogle_compute_instance
guest_acceleratorshostnames
: an array ofgoogle_compute_instance
hostnameinstance_ids
: an array ofgoogle_compute_instance
idlabel_fingerprints
: an array ofgoogle_compute_instance
label_fingerprintlabels
: an array ofgoogle_compute_instance
labelsmetadata
: an array ofgoogle_compute_instance
metadatamachine_types
: an array ofgoogle_compute_instance
machine_typemin_cpu_platforms
: an array ofgoogle_compute_instance
min_cpu_platforminstance_names
: an array ofgoogle_compute_instance
namenetwork_interfaces
: an array ofgoogle_compute_instance
network_interfacesschedulings
: an array ofgoogle_compute_instance
schedulingservice_accounts
: an array ofgoogle_compute_instance
service_accountsshielded_instance_configs
: an array ofgoogle_compute_instance
shielded_instance_configconfidential_instance_configs
: an array ofgoogle_compute_instance
confidential_instance_configstatuses
: an array ofgoogle_compute_instance
statusstatus_messages
: an array ofgoogle_compute_instance
status_messagetags
: an array ofgoogle_compute_instance
tagszones
: an array ofgoogle_compute_instance
zone
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 Compute Engine API is enabled for the current project.