Ресурс google_storage_buckets
Синтаксис
Используется google_storage_buckets, чтобы протестировать ресурс Google Bucket.
Примеры
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
Свойства
Свойства, к которым можно получить доступ из ресурса google_storage_buckets:
Для получения дополнительной информации см. ресурс google_storage_bucket.
acls- массив
google_storage_bucketacl cors- массив
google_storage_bucketcors default_event_based_holds- массив
google_storage_bucketdefault_event_based_hold default_object_acls- массив
google_storage_bucketdefault_object_acl bucket_ids- массив
google_storage_bucketid lifecycles- массив
google_storage_bucketlifecycle bucket_locations- массив
google_storage_bucketlocation loggings- массив
google_storage_bucketlogging metagenerations- массив
google_storage_bucketmetageneration bucket_names- массив
google_storage_bucketname owners- массив
google_storage_bucketowner bucket_project_numbers- массив
google_storage_bucketproject_number storage_classes- массив
google_storage_bucketstorage_class time_createds- массив
google_storage_buckettime_created updateds- массив
google_storage_bucketupdated versionings- массив
google_storage_bucketversioning websites- массив
google_storage_bucketwebsite labels- массив
google_storage_bucketlabels encryptions- массив
google_storage_bucketencryption retention_policies- массив
google_storage_bucketretention_policy projects- массив
google_storage_bucketproject predefined_default_object_acls- массив
google_storage_bucketpredefined_default_object_acl
Критерии фильтрации
Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые можно использовать с where в качестве блока или метода.
Разрешения GCP
Убедитесь, что Google Cloud Storage включен для текущего проекта.
© 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/