Skip to main content

nat_rules

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

Overview

Namenat_rules
TypeResource
Idazure.network.nat_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringName of the resource.
egressVpnSiteLinkConnectionsarrayList of egress VpnSiteLinkConnections.
etagstringA unique read-only string that changes whenever the resource is updated.
externalMappingsarrayThe private IP address external mapping for NAT.
ingressVpnSiteLinkConnectionsarrayList of ingress VpnSiteLinkConnections.
internalMappingsarrayThe private IP address internal mapping for NAT.
ipConfigurationIdstringThe IP Configuration ID this NAT rule applies to.
modestringThe Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and "IngressSnat". (EgressSnat, IngressSnat)
provisioningStatestringThe provisioning state of the NAT Rule resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, gateway_name, nat_rule_name, subscription_idRetrieves the details of a nat ruleGet.
list_by_vpn_gatewayselectresource_group_name, gateway_name, subscription_idRetrieves all nat rules for a particular virtual wan vpn gateway.
create_or_updateinsertresource_group_name, gateway_name, nat_rule_name, subscription_idCreates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules.
create_or_updatereplaceresource_group_name, gateway_name, nat_rule_name, subscription_idCreates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules.
deletedeleteresource_group_name, gateway_name, nat_rule_name, subscription_idDeletes a nat rule.

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.
nat_rule_namestringThe name of the resource that is unique within a resource group. This name can be used to access the resource. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Retrieves the details of a nat ruleGet.

SELECT
id,
name,
egressVpnSiteLinkConnections,
etag,
externalMappings,
ingressVpnSiteLinkConnections,
internalMappings,
ipConfigurationId,
mode,
provisioningState,
type
FROM azure.network.nat_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND gateway_name = '{{ gateway_name }}' -- required
AND nat_rule_name = '{{ nat_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules.

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

REPLACE examples

Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules.

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

DELETE examples

Deletes a nat rule.

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