Syntax
A google_storage_buckets
is used to test a Google Bucket resource
Examples
describe google_storage_buckets(project: 'chef-gcp-inspec') do
its('bucket_names') { should include bucket-name }
end
Test that there are no more than a specified number of storage buckets for the project
describe google_storage_buckets(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
Test that an expected named bucket is available
describe google_storage_buckets do
its('bucket_names'){ should include "my_expected_bucket" }
end
Test that all buckets belong to the expected project number
google_storage_buckets(project: 'chef-inspec-gcp').bucket_names.each do |bucket_name|
describe google_storage_bucket(name: bucket_name) do
it { should exist }
its('project_number'){ should eq 1122334455 }
end
end
Properties
Properties that can be accessed from the google_storage_buckets
resource:
See googlestoragebucket.md for more detailed information
* acls
: an array of google_storage_bucket
acl
* cors
: an array of google_storage_bucket
cors
* default_event_based_holds
: an array of google_storage_bucket
defaulteventbasedhold
* `defaultobjectacls: an array of
googlestoragebucket` defaultobjectacl
* `bucketids: an array of
googlestoragebucketid
*
lifecycles: an array of
googlestoragebucketlifecycle
*
bucketlocations: an array of
googlestoragebucketlocation
*
loggings: an array of
googlestoragebucketlogging
*
metagenerations: an array of
googlestoragebucketmetageneration
*
bucketnames: an array of
googlestoragebucketname
*
owners: an array of
googlestoragebucketowner
*
bucketprojectnumbers: an array of
googlestoragebucketproject_number
*
storageclasses: an array of
googlestoragebucket` storageclass
* time_createds
: an array of google_storage_bucket
timecreated
* updateds
: an array of `googlestoragebucketupdated
*
versionings: an array of
googlestoragebucketversioning
*
websites: an array of
googlestoragebucketwebsite
*
labels: an array of
googlestoragebucketlabels
*
encryptions: an array of
googlestoragebucketencryption
*
retentionpolicies: an array of
googlestoragebucketretention_policy
*
projects: an array of
googlestoragebucketproject
*
predefineddefaultobjectacls: an array of
googlestoragebucket` predefineddefaultobjectacl
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 Google Cloud Storage is enabled for the current project.