Skip to main content

vpn_gateways

Creates, updates, deletes, gets or lists a vpn_gateways resource.

Overview

Namevpn_gateways
TypeResource
Idazure.network.vpn_gateways

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
bgpSettingsobjectLocal network gateway's BGP speaker settings.
connectionsarrayList of all vpn connections to the gateway.
enableBgpRouteTranslationForNatbooleanEnable BGP routes translation for NAT on this VpnGateway.
etagstringA unique read-only string that changes whenever the resource is updated.
ipConfigurationsarrayList of all IPs configured on the gateway.
isRoutingPreferenceInternetbooleanEnable Routing Preference property for the Public IP Interface of the VpnGateway.
locationstringResource location.
natRulesarrayList of all the nat Rules associated with the gateway.
provisioningStatestringThe provisioning state of the VPN gateway resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
tagsobjectResource tags.
typestringResource type.
virtualHubobjectReference to another subresource.
vpnGatewayScaleUnitintegerThe scale unit for this vpn gateway.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, gateway_name, subscription_idRetrieves the details of a virtual wan vpn gateway.
list_by_resource_groupselectresource_group_name, subscription_idLists all the VpnGateways in a resource group.
listselectsubscription_idLists all the VpnGateways in a subscription.
create_or_updateinsertresource_group_name, gateway_name, subscription_idCreates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway.
update_tagsupdateresource_group_name, gateway_name, subscription_idUpdates virtual wan vpn gateway tags.
create_or_updatereplaceresource_group_name, gateway_name, subscription_idCreates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway.
deletedeleteresource_group_name, gateway_name, subscription_idDeletes a virtual wan vpn gateway.
resetexecresource_group_name, gateway_name, subscription_idipConfigurationIdResets the primary of the vpn gateway in the specified resource group.
start_packet_captureexecresource_group_name, gateway_name, subscription_idStarts packet capture on vpn gateway in the specified resource group.
stop_packet_captureexecresource_group_name, gateway_name, subscription_idStops packet capture on vpn gateway in the specified resource group.

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.

NameDatatypeDescription
gateway_namestringThe name of the gateway. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
ipConfigurationIdstringVpnGateway ipConfigurationId to specify the gateway instance. Default value is None.

SELECT examples

Retrieves the details of a virtual wan vpn gateway.

SELECT
id,
name,
bgpSettings,
connections,
enableBgpRouteTranslationForNat,
etag,
ipConfigurations,
isRoutingPreferenceInternet,
location,
natRules,
provisioningState,
tags,
type,
virtualHub,
vpnGatewayScaleUnit
FROM azure.network.vpn_gateways
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND gateway_name = '{{ gateway_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway.

INSERT INTO azure.network.vpn_gateways (
id,
location,
tags,
properties,
resource_group_name,
gateway_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ gateway_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;

UPDATE examples

Updates virtual wan vpn gateway tags.

UPDATE azure.network.vpn_gateways
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND gateway_name = '{{ gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;

REPLACE examples

Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway.

REPLACE azure.network.vpn_gateways
SET
id = '{{ id }}',
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND gateway_name = '{{ gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;

DELETE examples

Deletes a virtual wan vpn gateway.

DELETE FROM azure.network.vpn_gateways
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND gateway_name = '{{ gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Resets the primary of the vpn gateway in the specified resource group.

EXEC azure.network.vpn_gateways.reset 
@resource_group_name='{{ resource_group_name }}' --required,
@gateway_name='{{ gateway_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@ipConfigurationId='{{ ipConfigurationId }}'
;