google_compute_project_info resource
Syntax
A google_compute_project_info is used to test a Google ProjectInfo resource
Beta Resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource.
Examples
describe google_compute_project_info(project: 'chef-gcp-inspec') do
it { should exist }
its('default_service_account') { should match "developer.gserviceaccount.com" }
end
Test that GCP compute project information exists
describe google_compute_project_info(project: 'chef-inspec-gcp') do
it { should exist }
end
Test that GCP compute project default service account is as expected
describe google_compute_project_info(project: 'chef-inspec-gcp') do
its('default_service_account') { should eq '12345-compute@developer.gserviceaccount.com' }
end
Properties
Properties that can be accessed from the google_compute_project_info resource:
name: The name of this projectcommon_instance_metadata: Metadata shared for all instances in this projectitems: Array of key/valueskey: Key of the metadata key/value pairvalue: Value of the metadata key/value pair
enabled_features: Restricted features enabled for use on this projectdefault_service_account: Default service account used by VMs in this projectxpn_project_status: The role this project has in a shared VPC configuration.default_network_tier: The default network tier used for configuring resources in this projectquotas: Quotas applied to this projectmetric: Name of the quota metriclimit: Quota limit for this metricusage: Current usage of this metricowner: Owning resource. This is the resource on which this quota is applied.
creation_timestamp: Creation timestamp in RFC3339 text format.
GCP permissions
Ensure the Compute Engine API is enabled for the current project.