Ресурс google_compute_subnetworks
Синтаксис
Используется google_compute_subnetworks, чтобы проверить ресурс Google Subnetwork.
Ресурс Beta
Этот ресурс имеет доступные поля beta. Чтобы получить эти поля, включите beta: true в конструктор ресурса.
Примеры
describe google_compute_subnetworks(project: 'chef-gcp-inspec', region: 'europe-west2') do
its('ip_cidr_ranges') { should include '10.2.0.0/16' }
its('subnetwork_names') { should include 'inspec-subnet' }
end
Проверка, что для проекта и региона доступно не более указанного числа подсетей
describe google_compute_subnetworks(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('count') { should be <= 100}
end
Проверка, что ожидаемый идентификатор подсети присутствует в проекте и регионе
describe google_compute_subnetworks(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('subnetwork_ids') { should include 12345678975432 }
end
Проверка, что ожидаемое имя подсети доступно для проекта и региона
describe google_compute_subnetworks(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('subnetwork_names') { should include "subnetwork-name" }
end
Проверка, что ожидаемое имя сети подсети отсутствует для проекта и региона
describe google_compute_subnetworks(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('subnetwork_networks') { should not include "network-name" }
end
Свойства
Свойства, к которым можно получить доступ из ресурса google_compute_subnetworks:
См. ресурс google_compute_subnetwork для получения дополнительной информации.
creation_timestamps- массив
google_compute_subnetworkcreation_timestamp descriptions- массив
google_compute_subnetworkdescription gateway_addresses- массив
google_compute_subnetworkgateway_address subnetwork_ids- массив
google_compute_subnetworkid ip_cidr_ranges- массив
google_compute_subnetworkip_cidr_range subnetwork_names- массив
google_compute_subnetworkname networks- массив
google_compute_subnetworknetwork purposes- (Только Beta) массив
google_compute_subnetworkpurpose roles- (Только Beta) массив
google_compute_subnetworkrole secondary_ip_ranges- массив
google_compute_subnetworksecondary_ip_ranges private_ip_google_accesses- массив
google_compute_subnetworkprivate_ip_google_access regions- массив
google_compute_subnetworkregion log_configs- массив
google_compute_subnetworklog_config
Критерии фильтрации
Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые могут быть использованы с 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_subnetworks/