Project: Chef InSpec (Provisioning / Security & Compliance)
File: google_compute_network.md

+++ title = "googlecomputenetwork resource" draft = false gh_repo = "inspec" platform = "gcp" [menu] [menu.inspec] title = "googlecomputenetwork" identifier = "inspec/resources/gcp/googlecomputenetwork.md googlecomputenetwork resource" parent = "inspec/resources/gcp" +++ A `googlecomputenetwork` is used to test a Google Network resource This resource has beta fields available. To retrieve these fields, include `beta: true` in the constructor for the resource ```ruby describe googlecomputenetwork(project: 'chef-gcp-inspec', name: 'inspec-network') do it { should exist } its('routingconfig.routingmode') { should cmp 'REGIONAL' } end describe googlecomputenetwork(project: 'chef-gcp-inspec', name: 'nonexistent') do it { should_not exist } end ``` describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do it { should exist } end describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do its('creationtimestampdate') { should be > Time.now - 36560602410 } end describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do its('id') { should eq 12345567789 } end describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do its ('subnetworks.count') { should eq 1 } its ('subnetworks.first') { should match "subnetwork-name"} end describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do its ('autocreatesubnetworks'){ should be false } end describe googlecomputenetwork(project: 'chef-inspec-gcp', name: 'gcp-inspec-network') do its ('routingconfig.routingmode') { should eq "REGIONAL" } end Properties that can be accessed from the `googlecomputenetwork` resource: `description` : An optional description of this resource. The resource must be recreated to modify this field. `gateway_ipv4` : The gateway address for default routing out of the network. This value is selected by GCP. `id` : The unique identifier for the resource. `name` : Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. `subnetworks` : Server-defined fully-qualified URLs for all subnetworks in this network. `autocreatesubnetworks` : When set to `true`, the network is created in "auto subnet mode" and it will create a subnet for each region automatically across the `10.128.0.0/9` address range. When set to `false`, the network is created in "custom subnet mode" so the user can explicitly connect subnetwork resources. `creation_timestamp` : Creation timestamp in RFC3339 text format. `routing_config` : The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. `routing_mode` : The network-wide routing mode to use. If set to `REGIONAL`, this network's cloud routers will only advertise routes with subnetworks of this network in the same region as the router. If set to `GLOBAL`, this network's cloud routers will advertise routes with all subnetworks of this network, across regions. Possible values: REGIONAL GLOBAL Ensure the is enabled for the current project.