A google_storage_buckets is used to test a Google Bucket resource
describe google_storage_buckets(project: 'chef-gcp-inspec') do
its('bucket_names') { should include bucket-name }
end
describe google_storage_buckets(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
describe google_storage_buckets do
its('bucket_names'){ should include "my_expected_bucket" }
end
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 that can be accessed from the google_storage_buckets resource:
See the google_storage_bucket resource for more information.
aclsgoogle_storage_bucket aclcorsgoogle_storage_bucket corsdefault_event_based_holdsgoogle_storage_bucket default_event_based_holddefault_object_aclsgoogle_storage_bucket default_object_aclbucket_idsgoogle_storage_bucket idlifecyclesgoogle_storage_bucket lifecyclebucket_locationsgoogle_storage_bucket locationloggingsgoogle_storage_bucket loggingmetagenerationsgoogle_storage_bucket metagenerationbucket_namesgoogle_storage_bucket nameownersgoogle_storage_bucket ownerbucket_project_numbersgoogle_storage_bucket project_numberstorage_classesgoogle_storage_bucket storage_classtime_createdsgoogle_storage_bucket time_createdupdatedsgoogle_storage_bucket updatedversioningsgoogle_storage_bucket versioningwebsitesgoogle_storage_bucket websitelabelsgoogle_storage_bucket labelsencryptionsgoogle_storage_bucket encryptionretention_policiesgoogle_storage_bucket retention_policyprojectsgoogle_storage_bucket projectpredefined_default_object_aclsgoogle_storage_bucket predefined_default_object_aclThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
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/