Sha256: 6ba0e1fe1e35f57e1276650072fac8cf5b26b3dde7a1ef061b221a059d67ad7f

Contents?: true

Size: 1.4 KB

Versions: 79

Compression:

Stored size: 1.4 KB

Contents

# copyright: 2018, The Authors

title "Sample Section"

gcp_project_id = attribute("gcp_project_id")

# you add controls here
control "gcp-single-region-1.0" do                                                    # A unique ID for this control
  impact 1.0                                                                          # The criticality, if this control fails.
  title "Ensure single region has the correct properties."                            # A human-readable title
  desc "An optional description..."
  describe google_compute_region(project: gcp_project_id, name: "europe-west2") do    # The actual test
    its("zone_names") { should include "europe-west2-a" }
  end
end

# plural resources can be leveraged to loop across many resources
control "gcp-regions-loop-1.0" do                                                     # A unique ID for this control
  impact 1.0                                                                          # The criticality, if this control fails.
  title "Ensure regions have the correct properties in bulk."                         # A human-readable title
  desc "An optional description..."
  google_compute_regions(project: gcp_project_id).region_names.each do |region_name|  # Loop across all regions by name
    describe google_compute_region(project: gcp_project_id, name: region_name) do     # The test for a single region
      it { should be_up }
    end
  end
end

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
inspec-4.18.51 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.18.39 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.18.38 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.18.24 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.18.0 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.17.17 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.17.15 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.17.14 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.17.11 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.17.7 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.16.0 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.12.0 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.10.4 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.7.24 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.7.18 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.7.3 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.6.9 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.6.4 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb
inspec-4.6.3 lib/plugins/inspec-init/templates/profiles/gcp/controls/example.rb