Skip to content

Latest commit

 

History

History
56 lines (33 loc) · 1.48 KB

google_dns_managed_zone.md

File metadata and controls

56 lines (33 loc) · 1.48 KB
title platform
About the google_dns_managed_zones Resource
gcp

google_dns_managed_zone

Use the google_dns_managed_zones InSpec audit resource to test properties of a single GCP DNS managed zone.


Syntax

A google_dns_managed_zone resource block declares the tests for a single GCP zone by project and name.

describe google_dns_managed_zone(project: 'chef-inspec-gcp',  zone: 'zone-name') do
  it { should exist }
end

Examples

The following examples show how to use this InSpec audit resource.

Test that a GCP compute zone exists

describe google_dns_managed_zone(project: 'chef-inspec-gcp',  zone: 'zone-name') do
  it { should exist }
end

Test that a GCP DNS managed zone has the expected DNS name

describe google_dns_managed_zone(project: 'chef-inspec-gcp',  zone: 'zone-name') do
  its('dns_name') { should match 'mydomain.com' }
end

Test that a GCP DNS managed zone has expected name server

describe google_dns_managed_zone(project: 'chef-inspec-gcp',  zone: 'zone-name') do
  its('name_servers') { should include 'ns-cloud-d1.googledomains.com.' }
end

Properties

  • creation_time, creation_time_date, description, dns_name, dnssec_config, id, kind, name, name_servers, key_signing_key_algorithm, zone_signing_key_algorithm

GCP Permissions

Ensure the Cloud DNS API is enabled for the project.