azure_dns_zones_resources Resource
Use the azure_dns_zones_resources InSpec audit resource to test the properties related to all Azure DNS zones for a resource group or an entire subscription.
Azure REST API Version, Endpoint, and HTTP Client Parameters
This resource interacts with API versions supported by the resource provider.
The api_version can be defined as a resource parameter.
If not provided, this resource uses the latest version.
For more information, refer to the azure_generic_resource document.
Unless defined, this resource uses the azure_cloud global endpoint and default values for the HTTP client.
For more information, refer to the resource pack README.
Install
This resource is available in the Chef InSpec Azure resource pack.
For information on configuring your Azure environment for Chef InSpec and creating an InSpec profile that uses the InSpec Azure resource pack, see the Chef InSpec documentation for the Azure cloud platform.
Syntax
An azure_dns_zones_resources resource block returns all Azure DNS Zones within a resource group.
describe azure_dns_zones_resources do
#...
end
Parameters
This resource does not require any parameters.
Properties
name- A list of the unique resource names.
Field:
nameids- A list of DNS zone IDs.
Field:
idtags- A list of
tag:valuepairs defined on the resources. Field:
tagstypes- A list of the types of all DNS zones.
Field:
typeproperties- A list of the properties of the Azure DNS zone resources.
Field:
propertiesmax_number_of_recordsets- A list of the maximum number of records per record set that can be created in the DNS zones.
Field:
max_number_of_recordsetsnumber_of_record_sets- A list of the current number of record sets in the DNS zones.
Field:
number_of_record_setsname_servers- A list of the name servers for the DNS zones.
Field:
name_servers
Note
Examples
Test that a DNS zone has the correct type
describe azure_dns_zones_resources do
its('type') { should include 'Microsoft.Network/dnszones' }
end
Test that a DNS zone resource has a ‘Succeeded’ provisioning state
describe azure_dns_zones_resources do
its('provisioning_states') { should include 'Succeeded' }
end
Test that a DNS zone has the ‘global’ location
describe azure_dns_zones_resources do
its('location') { should include 'global' }
end
Test if any Azure DNS zone exists in the resource group
describe azure_dns_zones_resources do
it { should exist }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exists
Test that there are not any Azure DNS zones in the resource group.
describe azure_dns_zones_resources do
it { should_not exist }
end
Azure Permissions
Your Service Principal must be set up with at least a contributor role on the subscription you wish to test.