google_bigquery_datasets resource
Use the google_bigquery_datasets InSpec audit resource to to test a Google Cloud Dataset resource.
Examples
describe google_bigquery_datasets(project: 'chef-gcp-inspec') do
its('count') { should be >= 1 }
its('friendly_names') { should include 'A BigQuery dataset test' }
its('locations') { should include 'EU' }
end
google_bigquery_datasets(project: 'chef-gcp-inspec').ids.each do |name|
google_bigquery_dataset(project: 'chef-gcp-inspec', name: name.split(':').last).access.each do |access|
describe access do
# No bigquery dataset should allow access to allUsers
its('iam_member') { should_not cmp 'allUsers' }
end
end
end
Properties
Properties that can be accessed from the google_bigquery_datasets resource:
See google_bigquery_dataset for more detailed information.
dataset_references: an array ofgoogle_bigquery_datasetdataset_referencedefault_partition_expiration_ms: an array ofgoogle_bigquery_datasetdefault_partition_expiration_msetags: an array ofgoogle_bigquery_datasetetagfriendly_names: an array ofgoogle_bigquery_datasetfriendly_nameids: an array ofgoogle_bigquery_datasetidlabels: an array ofgoogle_bigquery_datasetlabelslocations: an array ofgoogle_bigquery_datasetlocationdefault_encryption_configurations: an array ofgoogle_bigquery_datasetdefault_encryption_configuration
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
GCP permissions
Ensure the BigQuery API is enabled for the current project.