azure-native.network.VirtualNetworkGatewayNatRule
Explore with Pulumi AI
VirtualNetworkGatewayNatRule Resource. Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2021-03-01.
Other available API versions: 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01.
Example Usage
VirtualNetworkGatewayNatRulePut
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualNetworkGatewayNatRule = new AzureNative.Network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRule", new()
{
ExternalMappings = new[]
{
new AzureNative.Network.Inputs.VpnNatRuleMappingArgs
{
AddressSpace = "192.168.21.0/24",
PortRange = "300-400",
},
},
InternalMappings = new[]
{
new AzureNative.Network.Inputs.VpnNatRuleMappingArgs
{
AddressSpace = "10.4.0.0/24",
PortRange = "200-300",
},
},
IpConfigurationId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
Mode = AzureNative.Network.VpnNatRuleMode.EgressSnat,
NatRuleName = "natRule1",
ResourceGroupName = "rg1",
Type = AzureNative.Network.VpnNatRuleType.Static,
VirtualNetworkGatewayName = "gateway1",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewVirtualNetworkGatewayNatRule(ctx, "virtualNetworkGatewayNatRule", &network.VirtualNetworkGatewayNatRuleArgs{
ExternalMappings: network.VpnNatRuleMappingArray{
&network.VpnNatRuleMappingArgs{
AddressSpace: pulumi.String("192.168.21.0/24"),
PortRange: pulumi.String("300-400"),
},
},
InternalMappings: network.VpnNatRuleMappingArray{
&network.VpnNatRuleMappingArgs{
AddressSpace: pulumi.String("10.4.0.0/24"),
PortRange: pulumi.String("200-300"),
},
},
IpConfigurationId: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"),
Mode: pulumi.String(network.VpnNatRuleModeEgressSnat),
NatRuleName: pulumi.String("natRule1"),
ResourceGroupName: pulumi.String("rg1"),
Type: pulumi.String(network.VpnNatRuleTypeStatic),
VirtualNetworkGatewayName: pulumi.String("gateway1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.VirtualNetworkGatewayNatRule;
import com.pulumi.azurenative.network.VirtualNetworkGatewayNatRuleArgs;
import com.pulumi.azurenative.network.inputs.VpnNatRuleMappingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var virtualNetworkGatewayNatRule = new VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRule", VirtualNetworkGatewayNatRuleArgs.builder()
.externalMappings(VpnNatRuleMappingArgs.builder()
.addressSpace("192.168.21.0/24")
.portRange("300-400")
.build())
.internalMappings(VpnNatRuleMappingArgs.builder()
.addressSpace("10.4.0.0/24")
.portRange("200-300")
.build())
.ipConfigurationId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default")
.mode("EgressSnat")
.natRuleName("natRule1")
.resourceGroupName("rg1")
.type("Static")
.virtualNetworkGatewayName("gateway1")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
virtual_network_gateway_nat_rule = azure_native.network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRule",
external_mappings=[{
"address_space": "192.168.21.0/24",
"port_range": "300-400",
}],
internal_mappings=[{
"address_space": "10.4.0.0/24",
"port_range": "200-300",
}],
ip_configuration_id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
mode=azure_native.network.VpnNatRuleMode.EGRESS_SNAT,
nat_rule_name="natRule1",
resource_group_name="rg1",
type=azure_native.network.VpnNatRuleType.STATIC,
virtual_network_gateway_name="gateway1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const virtualNetworkGatewayNatRule = new azure_native.network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRule", {
externalMappings: [{
addressSpace: "192.168.21.0/24",
portRange: "300-400",
}],
internalMappings: [{
addressSpace: "10.4.0.0/24",
portRange: "200-300",
}],
ipConfigurationId: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
mode: azure_native.network.VpnNatRuleMode.EgressSnat,
natRuleName: "natRule1",
resourceGroupName: "rg1",
type: azure_native.network.VpnNatRuleType.Static,
virtualNetworkGatewayName: "gateway1",
});
resources:
virtualNetworkGatewayNatRule:
type: azure-native:network:VirtualNetworkGatewayNatRule
properties:
externalMappings:
- addressSpace: 192.168.21.0/24
portRange: 300-400
internalMappings:
- addressSpace: 10.4.0.0/24
portRange: 200-300
ipConfigurationId: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default
mode: EgressSnat
natRuleName: natRule1
resourceGroupName: rg1
type: Static
virtualNetworkGatewayName: gateway1
Create VirtualNetworkGatewayNatRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualNetworkGatewayNatRule(name: string, args: VirtualNetworkGatewayNatRuleArgs, opts?: CustomResourceOptions);
@overload
def VirtualNetworkGatewayNatRule(resource_name: str,
args: VirtualNetworkGatewayNatRuleInitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualNetworkGatewayNatRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
virtual_network_gateway_name: Optional[str] = None,
external_mappings: Optional[Sequence[VpnNatRuleMappingArgs]] = None,
id: Optional[str] = None,
internal_mappings: Optional[Sequence[VpnNatRuleMappingArgs]] = None,
ip_configuration_id: Optional[str] = None,
mode: Optional[Union[str, VpnNatRuleMode]] = None,
name: Optional[str] = None,
nat_rule_name: Optional[str] = None,
type: Optional[Union[str, VpnNatRuleType]] = None)
func NewVirtualNetworkGatewayNatRule(ctx *Context, name string, args VirtualNetworkGatewayNatRuleArgs, opts ...ResourceOption) (*VirtualNetworkGatewayNatRule, error)
public VirtualNetworkGatewayNatRule(string name, VirtualNetworkGatewayNatRuleArgs args, CustomResourceOptions? opts = null)
public VirtualNetworkGatewayNatRule(String name, VirtualNetworkGatewayNatRuleArgs args)
public VirtualNetworkGatewayNatRule(String name, VirtualNetworkGatewayNatRuleArgs args, CustomResourceOptions options)
type: azure-native:network:VirtualNetworkGatewayNatRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VirtualNetworkGatewayNatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VirtualNetworkGatewayNatRuleInitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VirtualNetworkGatewayNatRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualNetworkGatewayNatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualNetworkGatewayNatRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var virtualNetworkGatewayNatRuleResource = new AzureNative.Network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRuleResource", new()
{
ResourceGroupName = "string",
VirtualNetworkGatewayName = "string",
ExternalMappings = new[]
{
new AzureNative.Network.Inputs.VpnNatRuleMappingArgs
{
AddressSpace = "string",
PortRange = "string",
},
},
Id = "string",
InternalMappings = new[]
{
new AzureNative.Network.Inputs.VpnNatRuleMappingArgs
{
AddressSpace = "string",
PortRange = "string",
},
},
IpConfigurationId = "string",
Mode = "string",
Name = "string",
NatRuleName = "string",
Type = "string",
});
example, err := network.NewVirtualNetworkGatewayNatRule(ctx, "virtualNetworkGatewayNatRuleResource", &network.VirtualNetworkGatewayNatRuleArgs{
ResourceGroupName: pulumi.String("string"),
VirtualNetworkGatewayName: pulumi.String("string"),
ExternalMappings: network.VpnNatRuleMappingArray{
&network.VpnNatRuleMappingArgs{
AddressSpace: pulumi.String("string"),
PortRange: pulumi.String("string"),
},
},
Id: pulumi.String("string"),
InternalMappings: network.VpnNatRuleMappingArray{
&network.VpnNatRuleMappingArgs{
AddressSpace: pulumi.String("string"),
PortRange: pulumi.String("string"),
},
},
IpConfigurationId: pulumi.String("string"),
Mode: pulumi.String("string"),
Name: pulumi.String("string"),
NatRuleName: pulumi.String("string"),
Type: pulumi.String("string"),
})
var virtualNetworkGatewayNatRuleResource = new VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRuleResource", VirtualNetworkGatewayNatRuleArgs.builder()
.resourceGroupName("string")
.virtualNetworkGatewayName("string")
.externalMappings(VpnNatRuleMappingArgs.builder()
.addressSpace("string")
.portRange("string")
.build())
.id("string")
.internalMappings(VpnNatRuleMappingArgs.builder()
.addressSpace("string")
.portRange("string")
.build())
.ipConfigurationId("string")
.mode("string")
.name("string")
.natRuleName("string")
.type("string")
.build());
virtual_network_gateway_nat_rule_resource = azure_native.network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRuleResource",
resource_group_name="string",
virtual_network_gateway_name="string",
external_mappings=[{
"address_space": "string",
"port_range": "string",
}],
id="string",
internal_mappings=[{
"address_space": "string",
"port_range": "string",
}],
ip_configuration_id="string",
mode="string",
name="string",
nat_rule_name="string",
type="string")
const virtualNetworkGatewayNatRuleResource = new azure_native.network.VirtualNetworkGatewayNatRule("virtualNetworkGatewayNatRuleResource", {
resourceGroupName: "string",
virtualNetworkGatewayName: "string",
externalMappings: [{
addressSpace: "string",
portRange: "string",
}],
id: "string",
internalMappings: [{
addressSpace: "string",
portRange: "string",
}],
ipConfigurationId: "string",
mode: "string",
name: "string",
natRuleName: "string",
type: "string",
});
type: azure-native:network:VirtualNetworkGatewayNatRule
properties:
externalMappings:
- addressSpace: string
portRange: string
id: string
internalMappings:
- addressSpace: string
portRange: string
ipConfigurationId: string
mode: string
name: string
natRuleName: string
resourceGroupName: string
type: string
virtualNetworkGatewayName: string
VirtualNetworkGatewayNatRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualNetworkGatewayNatRule resource accepts the following input properties:
- Resource
Group stringName - The resource group name of the Virtual Network Gateway.
- Virtual
Network stringGateway Name - The name of the gateway.
- External
Mappings List<Pulumi.Azure Native. Network. Inputs. Vpn Nat Rule Mapping> - The private IP address external mapping for NAT.
- Id string
- Resource ID.
- Internal
Mappings List<Pulumi.Azure Native. Network. Inputs. Vpn Nat Rule Mapping> - The private IP address internal mapping for NAT.
- Ip
Configuration stringId - The IP Configuration ID this NAT rule applies to.
- Mode
string | Pulumi.
Azure Native. Network. Vpn Nat Rule Mode - The Source NAT direction of a VPN NAT.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- Nat
Rule stringName - The name of the nat rule.
- Type
string | Pulumi.
Azure Native. Network. Vpn Nat Rule Type - The type of NAT rule for VPN NAT.
- Resource
Group stringName - The resource group name of the Virtual Network Gateway.
- Virtual
Network stringGateway Name - The name of the gateway.
- External
Mappings []VpnNat Rule Mapping Args - The private IP address external mapping for NAT.
- Id string
- Resource ID.
- Internal
Mappings []VpnNat Rule Mapping Args - The private IP address internal mapping for NAT.
- Ip
Configuration stringId - The IP Configuration ID this NAT rule applies to.
- Mode
string | Vpn
Nat Rule Mode - The Source NAT direction of a VPN NAT.
- Name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- Nat
Rule stringName - The name of the nat rule.
- Type
string | Vpn
Nat Rule Type - The type of NAT rule for VPN NAT.
- resource
Group StringName - The resource group name of the Virtual Network Gateway.
- virtual
Network StringGateway Name - The name of the gateway.
- external
Mappings List<VpnNat Rule Mapping> - The private IP address external mapping for NAT.
- id String
- Resource ID.
- internal
Mappings List<VpnNat Rule Mapping> - The private IP address internal mapping for NAT.
- ip
Configuration StringId - The IP Configuration ID this NAT rule applies to.
- mode
String | Vpn
Nat Rule Mode - The Source NAT direction of a VPN NAT.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- nat
Rule StringName - The name of the nat rule.
- type
String | Vpn
Nat Rule Type - The type of NAT rule for VPN NAT.
- resource
Group stringName - The resource group name of the Virtual Network Gateway.
- virtual
Network stringGateway Name - The name of the gateway.
- external
Mappings VpnNat Rule Mapping[] - The private IP address external mapping for NAT.
- id string
- Resource ID.
- internal
Mappings VpnNat Rule Mapping[] - The private IP address internal mapping for NAT.
- ip
Configuration stringId - The IP Configuration ID this NAT rule applies to.
- mode
string | Vpn
Nat Rule Mode - The Source NAT direction of a VPN NAT.
- name string
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- nat
Rule stringName - The name of the nat rule.
- type
string | Vpn
Nat Rule Type - The type of NAT rule for VPN NAT.
- resource_
group_ strname - The resource group name of the Virtual Network Gateway.
- virtual_
network_ strgateway_ name - The name of the gateway.
- external_
mappings Sequence[VpnNat Rule Mapping Args] - The private IP address external mapping for NAT.
- id str
- Resource ID.
- internal_
mappings Sequence[VpnNat Rule Mapping Args] - The private IP address internal mapping for NAT.
- ip_
configuration_ strid - The IP Configuration ID this NAT rule applies to.
- mode
str | Vpn
Nat Rule Mode - The Source NAT direction of a VPN NAT.
- name str
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- nat_
rule_ strname - The name of the nat rule.
- type
str | Vpn
Nat Rule Type - The type of NAT rule for VPN NAT.
- resource
Group StringName - The resource group name of the Virtual Network Gateway.
- virtual
Network StringGateway Name - The name of the gateway.
- external
Mappings List<Property Map> - The private IP address external mapping for NAT.
- id String
- Resource ID.
- internal
Mappings List<Property Map> - The private IP address internal mapping for NAT.
- ip
Configuration StringId - The IP Configuration ID this NAT rule applies to.
- mode
String | "Egress
Snat" | "Ingress Snat" - The Source NAT direction of a VPN NAT.
- name String
- The name of the resource that is unique within a resource group. This name can be used to access the resource.
- nat
Rule StringName - The name of the nat rule.
- type String | "Static" | "Dynamic"
- The type of NAT rule for VPN NAT.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualNetworkGatewayNatRule resource produces the following output properties:
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning state of the NAT Rule resource.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Provisioning
State string - The provisioning state of the NAT Rule resource.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning state of the NAT Rule resource.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- id string
- The provider-assigned unique ID for this managed resource.
- provisioning
State string - The provisioning state of the NAT Rule resource.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- id str
- The provider-assigned unique ID for this managed resource.
- provisioning_
state str - The provisioning state of the NAT Rule resource.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- provisioning
State String - The provisioning state of the NAT Rule resource.
Supporting Types
VpnNatRuleMapping, VpnNatRuleMappingArgs
- Address
Space string - Address space for Vpn NatRule mapping.
- Port
Range string - Port range for Vpn NatRule mapping.
- Address
Space string - Address space for Vpn NatRule mapping.
- Port
Range string - Port range for Vpn NatRule mapping.
- address
Space String - Address space for Vpn NatRule mapping.
- port
Range String - Port range for Vpn NatRule mapping.
- address
Space string - Address space for Vpn NatRule mapping.
- port
Range string - Port range for Vpn NatRule mapping.
- address_
space str - Address space for Vpn NatRule mapping.
- port_
range str - Port range for Vpn NatRule mapping.
- address
Space String - Address space for Vpn NatRule mapping.
- port
Range String - Port range for Vpn NatRule mapping.
VpnNatRuleMappingResponse, VpnNatRuleMappingResponseArgs
- Address
Space string - Address space for Vpn NatRule mapping.
- Port
Range string - Port range for Vpn NatRule mapping.
- Address
Space string - Address space for Vpn NatRule mapping.
- Port
Range string - Port range for Vpn NatRule mapping.
- address
Space String - Address space for Vpn NatRule mapping.
- port
Range String - Port range for Vpn NatRule mapping.
- address
Space string - Address space for Vpn NatRule mapping.
- port
Range string - Port range for Vpn NatRule mapping.
- address_
space str - Address space for Vpn NatRule mapping.
- port_
range str - Port range for Vpn NatRule mapping.
- address
Space String - Address space for Vpn NatRule mapping.
- port
Range String - Port range for Vpn NatRule mapping.
VpnNatRuleMode, VpnNatRuleModeArgs
- Egress
Snat - EgressSnat
- Ingress
Snat - IngressSnat
- Vpn
Nat Rule Mode Egress Snat - EgressSnat
- Vpn
Nat Rule Mode Ingress Snat - IngressSnat
- Egress
Snat - EgressSnat
- Ingress
Snat - IngressSnat
- Egress
Snat - EgressSnat
- Ingress
Snat - IngressSnat
- EGRESS_SNAT
- EgressSnat
- INGRESS_SNAT
- IngressSnat
- "Egress
Snat" - EgressSnat
- "Ingress
Snat" - IngressSnat
VpnNatRuleType, VpnNatRuleTypeArgs
- Static
- Static
- Dynamic
- Dynamic
- Vpn
Nat Rule Type Static - Static
- Vpn
Nat Rule Type Dynamic - Dynamic
- Static
- Static
- Dynamic
- Dynamic
- Static
- Static
- Dynamic
- Dynamic
- STATIC
- Static
- DYNAMIC
- Dynamic
- "Static"
- Static
- "Dynamic"
- Dynamic
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:VirtualNetworkGatewayNatRule natRule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0