On this page
google_storage_buckets resource
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 the google_storage_bucket resource for more information.
-
acls -
an array of
google_storage_bucketacl -
cors -
an array of
google_storage_bucketcors -
default_event_based_holds -
an array of
google_storage_bucketdefault_event_based_hold -
default_object_acls -
an array of
google_storage_bucketdefault_object_acl -
bucket_ids -
an array of
google_storage_bucketid -
lifecycles -
an array of
google_storage_bucketlifecycle -
bucket_locations -
an array of
google_storage_bucketlocation -
loggings -
an array of
google_storage_bucketlogging -
metagenerations -
an array of
google_storage_bucketmetageneration -
bucket_names -
an array of
google_storage_bucketname -
owners -
an array of
google_storage_bucketowner -
bucket_project_numbers -
an array of
google_storage_bucketproject_number -
storage_classes -
an array of
google_storage_bucketstorage_class -
time_createds -
an array of
google_storage_buckettime_created -
updateds -
an array of
google_storage_bucketupdated -
versionings -
an array of
google_storage_bucketversioning -
websites -
an array of
google_storage_bucketwebsite -
labels -
an array of
google_storage_bucketlabels -
encryptions -
an array of
google_storage_bucketencryption -
retention_policies -
an array of
google_storage_bucketretention_policy -
projects -
an array of
google_storage_bucketproject -
predefined_default_object_acls -
an array of
google_storage_bucketpredefined_default_object_acl
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.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_storage_buckets/