virtual_network_peerings
Creates, updates, deletes, gets or lists a virtual_network_peerings resource.
Overview
| Name | virtual_network_peerings |
| Type | Resource |
| Id | azure.network.virtual_network_peerings |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Name of the resource. |
allowForwardedTraffic | boolean | Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. |
allowGatewayTransit | boolean | If gateway links can be used in remote virtual networking to link to this virtual network. |
allowVirtualNetworkAccess | boolean | Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. |
doNotVerifyRemoteGateways | boolean | If we need to verify the provisioning state of the remote gateway. |
enableOnlyIPv6Peering | boolean | Whether only Ipv6 address space is peered for subnet peering. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
localAddressSpace | object | The local address space of the local virtual network that is peered. |
localSubnetNames | array | List of local subnet names that are subnet peered with remote virtual network. |
localVirtualNetworkAddressSpace | object | The current local address space of the local virtual network that is peered. |
peerCompleteVnets | boolean | Whether complete virtual network address space is peered. |
peeringState | string | The status of the virtual network peering. Known values are: "Initiated", "Connected", and "Disconnected". (Initiated, Connected, Disconnected) |
peeringSyncLevel | string | The peering sync status of the virtual network peering. Known values are: "FullyInSync", "RemoteNotInSync", "LocalNotInSync", and "LocalAndRemoteNotInSync". (FullyInSync, RemoteNotInSync, LocalNotInSync, LocalAndRemoteNotInSync) |
provisioningState | string | The provisioning state of the virtual network peering resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
remoteAddressSpace | object | The reference to the address space peered with the remote virtual network. |
remoteBgpCommunities | object | The reference to the remote virtual network's Bgp Communities. |
remoteSubnetNames | array | List of remote subnet names from remote virtual network that are subnet peered. |
remoteVirtualNetwork | object | Reference to another subresource. |
remoteVirtualNetworkAddressSpace | object | The reference to the current address space of the remote virtual network. |
remoteVirtualNetworkEncryption | object | The reference to the remote virtual network's encryption. |
resourceGuid | string | The resourceGuid property of the Virtual Network peering resource. |
type | string | Resource type. |
useRemoteGateways | boolean | If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Name of the resource. |
allowForwardedTraffic | boolean | Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. |
allowGatewayTransit | boolean | If gateway links can be used in remote virtual networking to link to this virtual network. |
allowVirtualNetworkAccess | boolean | Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. |
doNotVerifyRemoteGateways | boolean | If we need to verify the provisioning state of the remote gateway. |
enableOnlyIPv6Peering | boolean | Whether only Ipv6 address space is peered for subnet peering. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
localAddressSpace | object | The local address space of the local virtual network that is peered. |
localSubnetNames | array | List of local subnet names that are subnet peered with remote virtual network. |
localVirtualNetworkAddressSpace | object | The current local address space of the local virtual network that is peered. |
peerCompleteVnets | boolean | Whether complete virtual network address space is peered. |
peeringState | string | The status of the virtual network peering. Known values are: "Initiated", "Connected", and "Disconnected". (Initiated, Connected, Disconnected) |
peeringSyncLevel | string | The peering sync status of the virtual network peering. Known values are: "FullyInSync", "RemoteNotInSync", "LocalNotInSync", and "LocalAndRemoteNotInSync". (FullyInSync, RemoteNotInSync, LocalNotInSync, LocalAndRemoteNotInSync) |
provisioningState | string | The provisioning state of the virtual network peering resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
remoteAddressSpace | object | The reference to the address space peered with the remote virtual network. |
remoteBgpCommunities | object | The reference to the remote virtual network's Bgp Communities. |
remoteSubnetNames | array | List of remote subnet names from remote virtual network that are subnet peered. |
remoteVirtualNetwork | object | Reference to another subresource. |
remoteVirtualNetworkAddressSpace | object | The reference to the current address space of the remote virtual network. |
remoteVirtualNetworkEncryption | object | The reference to the remote virtual network's encryption. |
resourceGuid | string | The resourceGuid property of the Virtual Network peering resource. |
type | string | Resource type. |
useRemoteGateways | boolean | If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, virtual_network_name, virtual_network_peering_name, subscription_id | Gets the specified virtual network peering. | |
list | select | resource_group_name, virtual_network_name, subscription_id | Gets all virtual network peerings in a virtual network. | |
create_or_update | insert | resource_group_name, virtual_network_name, virtual_network_peering_name, subscription_id | syncRemoteAddressSpace | Creates or updates a peering in the specified virtual network. |
create_or_update | replace | resource_group_name, virtual_network_name, virtual_network_peering_name, subscription_id | syncRemoteAddressSpace | Creates or updates a peering in the specified virtual network. |
delete | delete | resource_group_name, virtual_network_name, virtual_network_peering_name, subscription_id | Deletes the specified virtual network peering. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
virtual_network_name | string | The name of the virtual network. Required. |
virtual_network_peering_name | string | The name of the virtual network peering. Required. |
syncRemoteAddressSpace | string | Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. "true" Default value is None. |
SELECT examples
- get
- list
Gets the specified virtual network peering.
SELECT
id,
name,
allowForwardedTraffic,
allowGatewayTransit,
allowVirtualNetworkAccess,
doNotVerifyRemoteGateways,
enableOnlyIPv6Peering,
etag,
localAddressSpace,
localSubnetNames,
localVirtualNetworkAddressSpace,
peerCompleteVnets,
peeringState,
peeringSyncLevel,
provisioningState,
remoteAddressSpace,
remoteBgpCommunities,
remoteSubnetNames,
remoteVirtualNetwork,
remoteVirtualNetworkAddressSpace,
remoteVirtualNetworkEncryption,
resourceGuid,
type,
useRemoteGateways
FROM azure.network.virtual_network_peerings
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_network_name = '{{ virtual_network_name }}' -- required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all virtual network peerings in a virtual network.
SELECT
id,
name,
allowForwardedTraffic,
allowGatewayTransit,
allowVirtualNetworkAccess,
doNotVerifyRemoteGateways,
enableOnlyIPv6Peering,
etag,
localAddressSpace,
localSubnetNames,
localVirtualNetworkAddressSpace,
peerCompleteVnets,
peeringState,
peeringSyncLevel,
provisioningState,
remoteAddressSpace,
remoteBgpCommunities,
remoteSubnetNames,
remoteVirtualNetwork,
remoteVirtualNetworkAddressSpace,
remoteVirtualNetworkEncryption,
resourceGuid,
type,
useRemoteGateways
FROM azure.network.virtual_network_peerings
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_network_name = '{{ virtual_network_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a peering in the specified virtual network.
INSERT INTO azure.network.virtual_network_peerings (
id,
name,
properties,
resource_group_name,
virtual_network_name,
virtual_network_peering_name,
subscription_id,
syncRemoteAddressSpace
)
SELECT
'{{ id }}',
'{{ name }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ virtual_network_name }}',
'{{ virtual_network_peering_name }}',
'{{ subscription_id }}',
'{{ syncRemoteAddressSpace }}'
RETURNING
id,
name,
etag,
properties,
type
;
# Description fields are for documentation purposes
- name: virtual_network_peerings
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the virtual_network_peerings resource.
- name: virtual_network_name
value: "{{ virtual_network_name }}"
description: Required parameter for the virtual_network_peerings resource.
- name: virtual_network_peering_name
value: "{{ virtual_network_peering_name }}"
description: Required parameter for the virtual_network_peerings resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the virtual_network_peerings resource.
- name: id
value: "{{ id }}"
description: |
Resource ID.
- name: name
value: "{{ name }}"
description: |
Name of the resource.
- name: properties
description: |
Properties of the virtual network peering.
value:
allowVirtualNetworkAccess: {{ allowVirtualNetworkAccess }}
allowForwardedTraffic: {{ allowForwardedTraffic }}
allowGatewayTransit: {{ allowGatewayTransit }}
useRemoteGateways: {{ useRemoteGateways }}
remoteVirtualNetwork:
id: "{{ id }}"
localAddressSpace:
addressPrefixes:
- "{{ addressPrefixes }}"
ipamPoolPrefixAllocations:
- pool:
id: "{{ id }}"
numberOfIpAddresses: "{{ numberOfIpAddresses }}"
allocatedAddressPrefixes: "{{ allocatedAddressPrefixes }}"
localVirtualNetworkAddressSpace:
addressPrefixes:
- "{{ addressPrefixes }}"
ipamPoolPrefixAllocations:
- pool:
id: "{{ id }}"
numberOfIpAddresses: "{{ numberOfIpAddresses }}"
allocatedAddressPrefixes: "{{ allocatedAddressPrefixes }}"
remoteAddressSpace:
addressPrefixes:
- "{{ addressPrefixes }}"
ipamPoolPrefixAllocations:
- pool:
id: "{{ id }}"
numberOfIpAddresses: "{{ numberOfIpAddresses }}"
allocatedAddressPrefixes: "{{ allocatedAddressPrefixes }}"
remoteVirtualNetworkAddressSpace:
addressPrefixes:
- "{{ addressPrefixes }}"
ipamPoolPrefixAllocations:
- pool:
id: "{{ id }}"
numberOfIpAddresses: "{{ numberOfIpAddresses }}"
allocatedAddressPrefixes: "{{ allocatedAddressPrefixes }}"
remoteBgpCommunities:
virtualNetworkCommunity: "{{ virtualNetworkCommunity }}"
regionalCommunity: "{{ regionalCommunity }}"
remoteVirtualNetworkEncryption:
enabled: {{ enabled }}
enforcement: "{{ enforcement }}"
peeringState: "{{ peeringState }}"
peeringSyncLevel: "{{ peeringSyncLevel }}"
provisioningState: "{{ provisioningState }}"
doNotVerifyRemoteGateways: {{ doNotVerifyRemoteGateways }}
resourceGuid: "{{ resourceGuid }}"
peerCompleteVnets: {{ peerCompleteVnets }}
enableOnlyIPv6Peering: {{ enableOnlyIPv6Peering }}
localSubnetNames:
- "{{ localSubnetNames }}"
remoteSubnetNames:
- "{{ remoteSubnetNames }}"
- name: syncRemoteAddressSpace
value: "{{ syncRemoteAddressSpace }}"
description: Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. "true" Default value is None.
description: Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. "true" Default value is None.
REPLACE examples
- create_or_update
Creates or updates a peering in the specified virtual network.
REPLACE azure.network.virtual_network_peerings
SET
id = '{{ id }}',
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_name = '{{ virtual_network_name }}' --required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND syncRemoteAddressSpace = '{{ syncRemoteAddressSpace}}'
RETURNING
id,
name,
etag,
properties,
type;
DELETE examples
- delete
Deletes the specified virtual network peering.
DELETE FROM azure.network.virtual_network_peerings
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_name = '{{ virtual_network_name }}' --required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;