A google_compute_firewalls is used to test a Google Firewall resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
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
describe google_compute_firewalls(project: 'chef-inspec-gcp').where(firewall_direction: 'INGRESS') do
it { should_not exist }
end
Properties that can be accessed from the google_compute_firewalls resource:
See the google_compute_firewall resource for more information.
allowedsgoogle_compute_firewall allowedcreation_timestampsgoogle_compute_firewall creation_timestampdeniedsgoogle_compute_firewall denieddescriptionsgoogle_compute_firewall descriptiondestination_rangesgoogle_compute_firewall destination_rangesfirewall_directionsgoogle_compute_firewall directiondisabledsgoogle_compute_firewall disabledlog_configsgoogle_compute_firewall log_configfirewall_idsgoogle_compute_firewall idfirewall_namesgoogle_compute_firewall namenetworksgoogle_compute_firewall networkprioritiesgoogle_compute_firewall prioritysource_rangesgoogle_compute_firewall source_rangessource_service_accountsgoogle_compute_firewall source_service_accountssource_tagsgoogle_compute_firewall source_tagstarget_service_accountsgoogle_compute_firewall target_service_accountstarget_tagsgoogle_compute_firewall target_tagsThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Compute Engine API is enabled for the current project.
© 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/