Spec-Zone.ru › Chef 16

Ресурс google_compute_firewalls

Синтаксис

Используется google_compute_firewalls, чтобы проверить ресурс Google Firewall.

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

Этот ресурс имеет поля бета-версии. Чтобы получить доступ к этим полям, включите 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 creation_timestamp
denieds
массив google_compute_firewall запрещённых правил
descriptions
массив google_compute_firewall description
destination_ranges
массив google_compute_firewall destination_ranges
firewall_directions
массив google_compute_firewall направления (direction)
disableds
массив google_compute_firewall disabled
log_configs
массив google_compute_firewall log_config
firewall_ids
массив google_compute_firewall id
firewall_names
массив google_compute_firewall name
networks
массив google_compute_firewall network
priorities
массив google_compute_firewall priority
source_ranges
массив google_compute_firewall source_ranges
source_service_accounts
массив google_compute_firewall source_service_accounts
source_tags
массив google_compute_firewall source_tags
target_service_accounts
массив google_compute_firewall target_service_accounts
target_tags
массив google_compute_firewall target_tags

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

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

Разрешения GCP

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

© 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