Skip to main content

azure_express_route_circuit Resource

Use the azure_express_route_circuit InSpec audit resource to test the properties of an Azure ExpressRoute circuit resource.

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

This resource requires the resource_group and ExpressRoute circuit circuit_name parameters, or the resource_id parameter for a valid query.

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'EXPRESS_CIRCUIT_NAME') do
  it { should exist }
end

or

describe azure_express_route_circuit(resource_id: 'RESOURCE_ID') do
  it { should exist }
end

Parameters

resource_group
The Azure resource group where the targeted resource resides.
circuit_name
The name of the ExpressRoute circuit.
resource_id
The resource ID of the ExpressRoute circuit.

Provide the resource_group and name parameters, or the resource_id parameter for a valid query.

Properties

resource_group
The name of the resource group where the ExpressRoute circuit resource resides.
name
The name of the ExpressRoute circuit.
type
The ExpressRoute circuit type.
provisioning_state
The provisioning state of ExpressRoute circuit resource.
location
The location of the ExpressRoute circuit resource.
service_provider_properties_bandwidth_in_mbps
The bandwidth in Mbps of the circuit when the circuit is provisioned on an ExpressRoutePort resource.
service_provider_properties_peering_location
The ExpressRoute circuit resource service provider peering location.
service_provider_properties_name
The name of the ExpressRoute circuit service provider name.
service_provider_provisioning_state
The service provider provisioning state of the ExpressRoute circuit resource. Possible values are NotProvisioned, Provisioning, Provisioned, and Deprovisioning.
service_key
The ServiceKey.
stag
The identifier of the circuit traffic. Outer tag for QinQ encapsulation.
global_reach_enabled
Flag denoting global reach status. boolean.
allow_global_reach
Flag to enable Global Reach on the ExpressRoute circuit. boolean.
gateway_manager_etag
The GatewayManager Etag.
allow_classic_operations
Whether Allow Classic Operations is set to true or false.
circuit_provisioning_state
The CircuitProvisioningState state of the resource.
sku_name
The name of the SKU.
sku_tier
The tier of the SKU. Possible values are Basic, Local, Standard, or Premium.
sku_family
The family of the SKU. Possible values are: UnlimitedData and MeteredData.

Also, refer to Azure documentation for other properties available. Any attribute in the response may be accessed with the key names separated by dots (.).

Examples

Test an ExpressRoute circuit resource has the correct type

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'EXPRESS_CIRCUIT_NAME') do
  its('type') { should eq 'Microsoft.Network/expressRouteCircuits' }
end

Test an ExpressRoute circuit resource is in a successful state

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'EXPRESS_CIRCUIT_NAME') do
  its('provisioning_state') { should eq 'Succeeded' }
end

Test the location of an ExpressRoute circuit resource

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'EXPRESS_CIRCUIT_NAME') do
  its('location') { should eq 'RESOURCE_LOCATION' }
end

Matchers

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

exists

# If an express circuit resource is found, it will exist.

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'EXPRESS_CIRCUIT_NAME') do
  it { should exist }
end

not_exists

# If an express circuit resources that aren't found, will not exist.

describe azure_express_route_circuit(resource_group: 'RESOURCE_GROUP', circuit_name: 'DOESNOTEXIST') 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.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results