Skip to main content

azure_express_route_circuit Resource

[edit on GitHub]

Use the azure_express_route_circuit InSpec audit resource to test 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.

Installation

This resource is available in the Chef InSpec Azure resource pack.

See the Chef InSpec documentation on cloud platforms for information on configuring your Azure environment for InSpec and creating an InSpec profile that uses the InSpec Azure resource pack.

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 that the targeted resource resides in.
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 for a valid query.

Properties

resource_group
The name of the resource group that the ExpressRoute circuit resource resides in.
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 the 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 the an ExpressRoute circuit resource is in 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 a express circuit resource is found it will exist

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

# express circuit resources that aren't found will not exist
describe azure_express_route_circuit(resource_group: 'MyResourceGroup', 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.

Was this page helpful?

×









Search Results