nat_rules
Creates, updates, deletes, gets or lists a nat_rules resource.
Overview
| Name | nat_rules |
| Type | Resource |
| Id | azure.network.nat_rules |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_vpn_gateway
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Name of the resource. |
egressVpnSiteLinkConnections | array | List of egress VpnSiteLinkConnections. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
externalMappings | array | The private IP address external mapping for NAT. |
ingressVpnSiteLinkConnections | array | List of ingress VpnSiteLinkConnections. |
internalMappings | array | The private IP address internal mapping for NAT. |
ipConfigurationId | string | The IP Configuration ID this NAT rule applies to. |
mode | string | The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and "IngressSnat". (EgressSnat, IngressSnat) |
provisioningState | string | The provisioning state of the NAT Rule resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
type | string | Resource type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Name of the resource. |
egressVpnSiteLinkConnections | array | List of egress VpnSiteLinkConnections. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
externalMappings | array | The private IP address external mapping for NAT. |
ingressVpnSiteLinkConnections | array | List of ingress VpnSiteLinkConnections. |
internalMappings | array | The private IP address internal mapping for NAT. |
ipConfigurationId | string | The IP Configuration ID this NAT rule applies to. |
mode | string | The Source NAT direction of a VPN NAT. Known values are: "EgressSnat" and "IngressSnat". (EgressSnat, IngressSnat) |
provisioningState | string | The provisioning state of the NAT Rule resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
type | string | Resource type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, gateway_name, nat_rule_name, subscription_id | Retrieves the details of a nat ruleGet. | |
list_by_vpn_gateway | select | resource_group_name, gateway_name, subscription_id | Retrieves all nat rules for a particular virtual wan vpn gateway. | |
create_or_update | insert | resource_group_name, gateway_name, nat_rule_name, subscription_id | Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. | |
create_or_update | replace | resource_group_name, gateway_name, nat_rule_name, subscription_id | Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. | |
delete | delete | resource_group_name, gateway_name, nat_rule_name, subscription_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
gateway_name | string | The name of the gateway. Required. |
nat_rule_name | string | The name of the resource that is unique within a resource group. This name can be used to access the resource. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_vpn_gateway
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
;
Retrieves all nat rules for a particular virtual wan vpn gateway.
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 subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: nat_rules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the nat_rules resource.
- name: gateway_name
value: "{{ gateway_name }}"
description: Required parameter for the nat_rules resource.
- name: nat_rule_name
value: "{{ nat_rule_name }}"
description: Required parameter for the nat_rules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the nat_rules resource.
- name: id
value: "{{ id }}"
description: |
Resource ID.
- name: name
value: "{{ name }}"
description: |
Name of the resource.
- name: properties
description: |
Properties of the VpnGateway NAT rule.
value:
provisioningState: "{{ provisioningState }}"
type: "{{ type }}"
mode: "{{ mode }}"
internalMappings:
- addressSpace: "{{ addressSpace }}"
portRange: "{{ portRange }}"
externalMappings:
- addressSpace: "{{ addressSpace }}"
portRange: "{{ portRange }}"
ipConfigurationId: "{{ ipConfigurationId }}"
egressVpnSiteLinkConnections:
- id: "{{ id }}"
ingressVpnSiteLinkConnections:
- id: "{{ id }}"
REPLACE examples
- create_or_update
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
- delete
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
;