Skip to content

Latest commit

 

History

History
92 lines (72 loc) · 4.18 KB

azure_express_route_providers.md

File metadata and controls

92 lines (72 loc) · 4.18 KB
title platform
About the azure_express_route_providers Resource
azure

azure_express_route_providers

Use the azure_express_route_providers InSpec audit resource to test properties related to azure_express_route for a resource group or the 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, the latest version will be used. For more information, refer to azure_generic_resource.

Unless defined, azure_cloud global endpoint and default values for the HTTP client will be used. For more information, refer to the resource pack README. For api related info : Azure Express Route Providers Docs.

Availability

Installation

This resource is available in the InSpec Azure resource pack. For an example inspec.yml file and how to set up your Azure credentials, refer to resource pack README.

Syntax

An azure_express_route_providers resource block returns all Azure azure_express_route, either within a Resource Group (if provided), or within an entire Subscription.

describe azure_express_route_providers do
  #...
end

or

describe azure_express_route_providers(resource_group: 'my-rg') do
  #...
end

Parameters

  • resource_group (Optional)

Properties

Property Description Filter Criteria*
names A list of the unique resource ids. name
types A list of all the azure_express_route. type
ids A list of id for all the azure_express_route. id
tags A list of all the express_route names. tag
provisioning_states A list of status of request provisioning_state
peering_locations_list A list of peering locations pairs defined on the resources. locations
bandwidths_offered_list A list of bandwidths offered pairs defined on the resources. bandwidths

* For information on how to use filter criteria on plural resources refer to FilterTable usage.

Examples

Test If Any azure_express_route Exist in the Resource Group

describe azure_express_route_providers(resource_group: 'MyResourceGroup') do
  it { should exist }
end
describe azure_express_route_providers do
  it { should exist }
end

Test that There are express_route that Includes a Certain String in their Names (Server Side Filtering via Generic Resource - Recommended)

describe azure_generic_resources(resource_group: 'MyResourceGroup') do
  it { should exist }
end

Matchers

This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.

# Should not exist if no azure_express_route are in the resource group
describe azure_express_route_providers(resource_group: 'MyResourceGroup') do
  its('provisioning_states') { should include('Succeeded') }
  its('peering_locations_list') { should include(["Melbourne", "Sydney"]) }
  its('bandwidths_offered_list') { should include('bandwidths_offered') }
end

Azure Permissions

Your Service Principal must be setup with a contributor role on the subscription you wish to test.