Spec-Zone.ru › Chef 17

Ресурс google_logging_folder_exclusion

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

Синтаксис

Используется google_logging_folder_exclusion для проверки ресурса Google FolderExclusion.

Примеры

# Getting folder exclusions is complicated due to the name being generated by the server.
# This can be drastically simplified if you have the name when writing the test
describe.one do
  google_resourcemanager_folders(parent: 'organizations/12345').names.each do |folder_name|
    # name on a folder is in the form `folders/12345`
    google_logging_folder_exclusions(folder: folder_name.split('/')[1]).names.each do |exclusion_name|
      describe google_logging_folder_exclusion(folder: folder_name.split('/')[1], name: exclusion_name) do
        its('name'){ should cmp 'inspec-folder-exclusion' }
        its('description'){ should cmp 'My folder exclusion description' }
        its('filter'){ should cmp 'resource.type = gce_instance AND severity <= DEBUG' }
      end
    end
  end
end

Свойства

Свойства, доступные для ресурса google_logging_folder_exclusion:

folder
Идентификатор папки, к которой относится исключение.
name
Имя исключения, заданное сервером во время создания.
description
Описание исключения, предоставленное пользователем.
filter
Расширенный фильтр логов. Единственные экспортируемые записи логов — те, которые находятся в ресурсе, владеющем стоком, и соответствуют фильтру.
disabled
Если установлено в true, то это исключение отключено и не исключает никакие записи логов.

Разрешения GCP

Убедитесь, что для текущего проекта включен API Stackdriver Logging.

© 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_logging_folder_exclusion/

Spec-Zone.ru

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