google_compute_forwarding_rules resource
Syntax
A google_compute_forwarding_rules is used to test a Google ForwardingRule resource
Beta Resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource.
Examples
describe google_compute_forwarding_rules(project: 'chef-gcp-inspec', region: 'europe-west2') do
its('forwarding_rule_names') { should include 'udp-forwarding-rule' }
end
Test that there are no more than a specified number of forwarding_rules available for the project and region
describe google_compute_forwarding_rules(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('count') { should be <= 100}
end
Test that an expected forwarding_rule identifier is present in the project and region
describe google_compute_forwarding_rules(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('forwarding_rule_ids') { should include 12345678975432 }
end
Test that an expected forwarding_rule name is available for the project and region
describe google_compute_forwarding_rules(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('forwarding_rule_names') { should include "forwarding_rule-name" }
end
Test that an expected forwarding_rule network name is not present for the project and region
describe google_compute_forwarding_rules(project: 'chef-inspec-gcp', region: 'europe-west2') do
its('forwarding_rule_networks') { should not include "network-name" }
end
Properties
Properties that can be accessed from the google_compute_forwarding_rules resource:
See google_compute_forwarding_rule for more detailed information.
creation_timestamps: an array ofgoogle_compute_forwarding_rulecreation_timestampis_mirroring_collectors: an array ofgoogle_compute_forwarding_ruleis_mirroring_collectordescriptions: an array ofgoogle_compute_forwarding_ruledescriptionforwarding_rule_ids: an array ofgoogle_compute_forwarding_ruleidip_addresses: an array ofgoogle_compute_forwarding_ruleip_addressip_protocols: an array ofgoogle_compute_forwarding_ruleip_protocolbackend_services: an array ofgoogle_compute_forwarding_rulebackend_serviceforwarding_rule_load_balancing_schemes: an array ofgoogle_compute_forwarding_ruleload_balancing_schemeforwarding_rule_names: an array ofgoogle_compute_forwarding_rulenameforwarding_rule_networks: an array ofgoogle_compute_forwarding_rulenetworkport_ranges: an array ofgoogle_compute_forwarding_ruleport_rangeports: an array ofgoogle_compute_forwarding_ruleportssubnetworks: an array ofgoogle_compute_forwarding_rulesubnetworktargets: an array ofgoogle_compute_forwarding_ruletargetallow_global_accesses: an array ofgoogle_compute_forwarding_ruleallow_global_accesslabels: (Beta only) an array ofgoogle_compute_forwarding_rulelabelslabel_fingerprints: (Beta only) an array ofgoogle_compute_forwarding_rulelabel_fingerprintall_ports: an array ofgoogle_compute_forwarding_ruleall_portsnetwork_tiers: an array ofgoogle_compute_forwarding_rulenetwork_tierservice_labels: an array ofgoogle_compute_forwarding_ruleservice_labelservice_names: an array ofgoogle_compute_forwarding_ruleservice_nameregions: an array ofgoogle_compute_forwarding_ruleregion
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
GCP permissions
Ensure the Compute Engine API is enabled for the current project.