aws_hosted_zones Resource
Use the aws_hosted_zones
InSpec audit resource to test the properties of multiple AWS Route53 hosted zones.
The AWS::Route53::HostedZone
creates a new public or private hosted zone.
For additional information, including details on parameters and properties, see the AWS documentation on the AWS::Route53::HostedZone
resource.
Installation
This resource is available in the Chef InSpec AWS resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.
Syntax
Ensure the hosted zones are available
describe aws_hosted_zones do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
ids
- The ID that Amazon Route 53 assigned to the hosted zone when you created it.
-
Field:
id
names
- The name of the domain.
-
Field:
name
caller_references
- The value that you specified for CallerReference when you created the hosted zone.
-
Field:
caller_reference
configs
- A complex type that includes the Comment and PrivateZone elements.
-
Field:
config
resource_record_set_counts
- The number of resource record sets in the hosted zone.
-
Field:
resource_record_set_count
linked_services
- If the hosted zone was created by another service, the service that created the hosted zone.
-
Field:
linked_service
Examples
Ensure that there are more than one hosted zone.
describe aws_hosted_zones do
its('count') { should >= 1 }
end
Ensure a hosted zone is available.
describe aws_hosted_zones do
its('ids') { should include 'HOSTED_ZONE_ID' }
end
Ensure a hosted zone name is available.
describe aws_hosted_zones do
its('names') { should include 'HOSTED_ZONE_NAME' }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
The controls will pass if the list
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_hosted_zones do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_hosted_zones do
it { should_not exist }
end
AWS Permissions
Your Principal will need the Route53:Client:ListHostedZonesResponse
action with Effect
set to Allow
.
Was this page helpful?