azure_express_route_circuits Resource
Use the azure_express_route_circuits InSpec audit resource to test the properties of Azure ExpressRoute circuits for a resource group.
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 is used. For more information, refer to azure_generic_resource.
Unless defined, azure_cloud global endpoint and default values for the HTTP client is used. 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_express_route_circuits resource block returns all Azure ExpressRoute circuits within a resource group.
describe azure_express_route_circuits(resource_group: 'RESOURCE_GROUP') do
#...
end
Parameters
resource_group- The Azure resource group where the targeted resources resides.
Properties
names- A list of name the resource group in which to create the ExpressRoute circuit.
Field:
nameids- A list of the ExpressRoute circuit IDs.
Field:
idtags- A list of
tag:valuepairs of the ExpressRoute circuit resources. Field:
tagsprovisioning_states- The provisioning states of the ExpressRoute circuit resources.
Field:
provisioning_statetypes- The types of all the ExpressRoute circuit resources.
Field:
typelocations- The locations of the ExpressRoute circuit resources.
Field:
locationservice_provider_bandwidth_in_mbps- A list of the bandwidths in Mbps of the circuits when a circuit is provisioned on an
ExpressRoutePortresource. Field:
service_provider_bandwidth_in_mbpsservice_provider_peering_locations- A list of The name of the peering location and not the Azure resource location.
Field:
service_provider_peering_locationservice_provider_names- The name of the ExpressRoute Service Provider.
Field:
service_provider_nameservice_keys- The ServiceKeys of the ExpressRoute circuit resources.
Field:
service_keystags- The identifiers of the circuit traffic. Outer tag for
QinQencapsulation. Field:
stagglobal_reach_enabled- A list of the ExpressRoute circuit that denotes global reach enable status.
Field:
global_reach_enabledgateway_manager_etags- A list of the
GatewayManagerEtags in the ExpressRoute circuit resources. Field:
gateway_manager_etagallow_classic_operations- A list of indicating whether
Allow Classic Operationsin the ExpressRoute circuit resources is set totrueorfalse. Field:
allow_classic_operationcircuit_provisioning_states- A list of State of express
circuitHostNamecreation. Valid values areEnabledorDisabled. Field:
circuit_provisioning_statesku_names- A list of the SKU names of the ExpressRoute circuits.
Field:
sku_namesku_tiers- A list of the SKU tiers of the ExpressRoute circuits. Possible values are
Basic,Local,Standard, orPremium. Field:
sku_tiersku_family- A list of the SKU families of the ExpressRoute circuits. Possible values are:
UnlimitedDataandMeteredData. Field:
sku_family
Note
Also, see the Azure documentation for other available properties.
Examples
Ensure that an ExpressRoute circuit has a ‘Succeeded’ provisioning state
describe azure_express_route_circuits(resource_group: 'RESOURCE_GROUP') do
its('provisioning_states') { should include 'Succeeded' }
end
Test than an ExpressRoute circuit has a specific location
describe azure_express_route_circuits(resource_group: 'RESOURCE_GROUP') do
its('location') { should include 'EXPRESS_ROUTE_CIRCUIT_LOCATION' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exists
# Should exist if express_route_circuits are in the resource group.
describe azure_express_route_circuits(resource_group: 'RESOURCE_GROUP') do
it { should exist }
end
not_exists
# Should not exist if no express_route_circuits are in the resource group
describe azure_express_route_circuits(resource_group: 'RESOURCE_GROUP') 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.