Spec-Zone.ru › Chef 18

Ресурс google_storage_buckets

[править на GitHub]

Синтаксис

Для проверки ресурса Google Bucket используется google_storage_buckets

Примеры

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_bucket acl
cors
массив google_storage_bucket cors
default_event_based_holds
массив google_storage_bucket default_event_based_hold
default_object_acls
массив google_storage_bucket default_object_acl
bucket_ids
массив google_storage_bucket id
lifecycles
массив google_storage_bucket lifecycle
bucket_locations
массив google_storage_bucket location
loggings
массив google_storage_bucket logging
metagenerations
массив google_storage_bucket metageneration
bucket_names
массив google_storage_bucket name
owners
массив google_storage_bucket owner
bucket_project_numbers
массив google_storage_bucket project_number
storage_classes
массив google_storage_bucket storage_class
time_createds
массив google_storage_bucket time_created
updateds
массив google_storage_bucket updated
versionings
массив google_storage_bucket versioning
websites
массив google_storage_bucket website
labels
массив google_storage_bucket labels
encryptions
массив google_storage_bucket encryption
retention_policies
массив google_storage_bucket retention_policy
projects
массив google_storage_bucket project
predefined_default_object_acls
массив google_storage_bucket predefined_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/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API