Ресурс google_organizations
Синтаксис
Для проверки ресурса организации Google используется google_organizations
Примеры
describe google_organizations do
its('names') { should include "organizations/123456" }
end
Проверка, что доступно не более определенного числа организаций
describe google_organizations do
its('count') { should be <= 100}
end
Проверка, что доступно ожидаемое имя организации
describe google_organizations do
its('names') { should include "organization/1234" }
end
Проверка, что доступно ожидаемое отображаемое имя организации
describe google_organizations do
its('display_names') { should include "google.com" }
end
Проверка, что все организации активны
describe google_organizations do
its('lifecycle_state'){ should eq 'ACTIVE' }
end
Проверка наличия определенного подмножества активных организаций с отображаемым именем 'goog*'
google_organizations.where(display_name: /^goog/, lifecycle_state: 'ACTIVE').names.each do |name|
describe google_organization(name: name) do
it { should exist }
end
end
Свойства
Свойства, к которым можно получить доступ из ресурса google_organizations:
Для получения дополнительной информации см. ресурс google_organization.
names- массив имён
google_organization display_names- массив отображаемых имён
google_organization lifecycle_states- массив состояний жизненного цикла
google_organization creation_times- массив времен создания
google_organization owners- массив владельцев
google_organization
Критерии фильтрации
Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые могут быть использованы с where в виде блока или метода.
Разрешения GCP
Убедитесь, что для текущего проекта включен API Cloud Resource Manager.
© 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_organizations/