azure_express_route_providers resource
Use the azure_express_route_providers InSpec audit resource to test the 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.
You can specify the api_version as a resource parameter to use a specific version of the Azure REST API.
If you don’t specify an API version, this resource uses the latest version available.
For more information about API versioning, see the azure_generic_resource.
By default, this resource uses the azure_cloud global endpoint and default HTTP client settings.
You can override these settings if you need to connect to a different Azure environment (such as Azure Government or Azure China).
For more information about configuration options, see the 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 an entire Subscription.
describe azure_express_route_providers do
#...
end
Or
describe azure_express_route_providers(resource_group: 'RESOURCE_GROUP') do
#...
end
Parameters
resource_group(optional)The name of the resource group.
Properties
names- A list of the unique resource IDs.
Field:
name types- A list of all the azure_express_route.
Field:
type ids- A list of id for all the azure_express_route.
Field:
id - A list of all the express_route names.
Field:
tag provisioning_states- A list of the status of the request.
Field:
provisioning_state peering_locations_list- A list of
peering locationspairs defined on the resources.Field:
locations bandwidths_offered_list- A list of
bandwidths offeredpairs defined on the resources.Field:
bandwidths
Note
Examples
Test if any azure_express_route exists in the resource group:
describe azure_express_route_providers(resource_group: 'RESOURCE_GROUP') do
it { should exist }
end
describe azure_express_route_providers do
it { should exist }
end
Test that there are express_route that includes a string in names (Server Side Filtering via Generic Resource - Recommended):
describe azure_generic_resources(resource_group: 'RESOURCE_GROUP') do
it { should exist }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.# Should not exist if no azure_express_route is in the resource group.
describe azure_express_route_providers(resource_group: 'RESOURCE_GROUP') 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 set up with at least a contributor role on the subscription you wish to test.