Spec-Zone.ru › Chef 17

Ресурс google_compute_firewalls

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

Синтаксис

Для проверки ресурса Google Firewall используется google_compute_firewalls.

Ресурс бета-версии

Этот ресурс имеет доступные поля бета-версии. Чтобы получить доступ к этим полям, включите beta: true в конструктор ресурса.

Примеры

describe google_compute_firewalls(project: 'chef-gcp-inspec') do
  its('count') { should be >= 1 }
  its('firewall_names') { should include 'inspec-gcp-firewall' }
  its('firewall_directions') { should include 'INGRESS' }
end

Проверка, что для проекта доступно не более указанного количества брандмауэров

describe google_compute_firewalls(project: 'chef-inspec-gcp') do
  its('count') { should be <= 100}
end

Проверка, что ожидаемый брандмауэр доступен для проекта

describe google_compute_firewalls(project: 'chef-inspec-gcp') do
  its('firewall_names') { should include "my-app-firewall-rule" }
end

Проверка, что конкретное правило с заданным именем не существует

describe google_compute_firewalls(project: 'chef-inspec-gcp') do
  its('firewall_names') { should_not include "default-allow-ssh" }
end

Проверка, что нет брандмауэров для направления «INGRESS»

describe google_compute_firewalls(project: 'chef-inspec-gcp').where(firewall_direction: 'INGRESS') do
  it { should_not exist }
end

Свойства

Свойства, к которым можно получить доступ из ресурса google_compute_firewalls.

Дополнительную информацию см. в ресурсе google_compute_firewall.

alloweds
массив google_compute_firewall разрешенных
creation_timestamps
массив google_compute_firewall timestamp создания
denieds
массив google_compute_firewall запрещенных
descriptions
массив google_compute_firewall описание
destination_ranges
массив google_compute_firewall диапазоны назначения
firewall_directions
массив google_compute_firewall направление
disableds
массив google_compute_firewall отключено
log_configs
массив google_compute_firewall конфигурация логирования
firewall_ids
массив google_compute_firewall id
firewall_names
массив google_compute_firewall имя
networks
массив google_compute_firewall сеть
priorities
массив google_compute_firewall приоритет
source_ranges
массив google_compute_firewall диапазоны источников
source_service_accounts
массив google_compute_firewall учетные записи служб источника
source_tags
массив google_compute_firewall теги источника
target_service_accounts
массив google_compute_firewall учетные записи служб назначения
target_tags
массив google_compute_firewall теги назначения

Критерии фильтрации

Этот ресурс поддерживает все вышеперечисленные свойства как критерии фильтрации, которые могут использоваться с where как блоком или методом.

Разрешения GCP

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

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

Spec-Zone.ru

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