1. Packages
  2. Azure Native
  3. API Docs
  4. network
  5. VirtualNetworkGatewayNatRule
Azure Native v1.103.0 published on Friday, Jun 2, 2023 by Pulumi

azure-native.network.VirtualNetworkGatewayNatRule

Explore with Pulumi AI

azure-native logo
Azure Native v1.103.0 published on Friday, Jun 2, 2023 by Pulumi

    VirtualNetworkGatewayNatRule Resource. API Version: 2021-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",
                },
            },
            InternalMappings = new[]
            {
                new AzureNative.Network.Inputs.VpnNatRuleMappingArgs
                {
                    AddressSpace = "10.4.0.0/24",
                },
            },
            IpConfigurationId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
            Mode = "EgressSnat",
            NatRuleName = "natRule1",
            ResourceGroupName = "rg1",
            Type = "Static",
            VirtualNetworkGatewayName = "gateway1",
        });
    
    });
    
    package main
    
    import (
    	network "github.com/pulumi/pulumi-azure-native-sdk/network"
    	"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.VpnNatRuleMappingArgs{
    				{
    					AddressSpace: pulumi.String("192.168.21.0/24"),
    				},
    			},
    			InternalMappings: []network.VpnNatRuleMappingArgs{
    				{
    					AddressSpace: pulumi.String("10.4.0.0/24"),
    				},
    			},
    			IpConfigurationId:         pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default"),
    			Mode:                      pulumi.String("EgressSnat"),
    			NatRuleName:               pulumi.String("natRule1"),
    			ResourceGroupName:         pulumi.String("rg1"),
    			Type:                      pulumi.String("Static"),
    			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 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(Map.of("addressSpace", "192.168.21.0/24"))
                .internalMappings(Map.of("addressSpace", "10.4.0.0/24"))
                .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=[azure_native.network.VpnNatRuleMappingArgs(
            address_space="192.168.21.0/24",
        )],
        internal_mappings=[azure_native.network.VpnNatRuleMappingArgs(
            address_space="10.4.0.0/24",
        )],
        ip_configuration_id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
        mode="EgressSnat",
        nat_rule_name="natRule1",
        resource_group_name="rg1",
        type="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",
        }],
        internalMappings: [{
            addressSpace: "10.4.0.0/24",
        }],
        ipConfigurationId: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default",
        mode: "EgressSnat",
        natRuleName: "natRule1",
        resourceGroupName: "rg1",
        type: "Static",
        virtualNetworkGatewayName: "gateway1",
    });
    
    resources:
      virtualNetworkGatewayNatRule:
        type: azure-native:network:VirtualNetworkGatewayNatRule
        properties:
          externalMappings:
            - addressSpace: 192.168.21.0/24
          internalMappings:
            - addressSpace: 10.4.0.0/24
          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

    new VirtualNetworkGatewayNatRule(name: string, args: VirtualNetworkGatewayNatRuleArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualNetworkGatewayNatRule(resource_name: str,
                                     opts: Optional[ResourceOptions] = 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,
                                     resource_group_name: Optional[str] = None,
                                     type: Optional[Union[str, VpnNatRuleType]] = None,
                                     virtual_network_gateway_name: Optional[str] = None)
    @overload
    def VirtualNetworkGatewayNatRule(resource_name: str,
                                     args: VirtualNetworkGatewayNatRuleArgs,
                                     opts: Optional[ResourceOptions] = 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.
    
    
    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 VirtualNetworkGatewayNatRuleArgs
    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.

    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

    The VirtualNetworkGatewayNatRule resource accepts the following input properties:

    ResourceGroupName string

    The resource group name of the Virtual Network Gateway.

    VirtualNetworkGatewayName string

    The name of the gateway.

    ExternalMappings List<Pulumi.AzureNative.Network.Inputs.VpnNatRuleMappingArgs>

    The private IP address external mapping for NAT.

    Id string

    Resource ID.

    InternalMappings List<Pulumi.AzureNative.Network.Inputs.VpnNatRuleMappingArgs>

    The private IP address internal mapping for NAT.

    IpConfigurationId string

    The IP Configuration ID this NAT rule applies to.

    Mode string | Pulumi.AzureNative.Network.VpnNatRuleMode

    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.

    NatRuleName string

    The name of the nat rule.

    Type string | Pulumi.AzureNative.Network.VpnNatRuleType

    The type of NAT rule for VPN NAT.

    ResourceGroupName string

    The resource group name of the Virtual Network Gateway.

    VirtualNetworkGatewayName string

    The name of the gateway.

    ExternalMappings []VpnNatRuleMappingArgs

    The private IP address external mapping for NAT.

    Id string

    Resource ID.

    InternalMappings []VpnNatRuleMappingArgs

    The private IP address internal mapping for NAT.

    IpConfigurationId string

    The IP Configuration ID this NAT rule applies to.

    Mode string | VpnNatRuleMode

    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.

    NatRuleName string

    The name of the nat rule.

    Type string | VpnNatRuleType

    The type of NAT rule for VPN NAT.

    resourceGroupName String

    The resource group name of the Virtual Network Gateway.

    virtualNetworkGatewayName String

    The name of the gateway.

    externalMappings List<VpnNatRuleMappingArgs>

    The private IP address external mapping for NAT.

    id String

    Resource ID.

    internalMappings List<VpnNatRuleMappingArgs>

    The private IP address internal mapping for NAT.

    ipConfigurationId String

    The IP Configuration ID this NAT rule applies to.

    mode String | VpnNatRuleMode

    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.

    natRuleName String

    The name of the nat rule.

    type String | VpnNatRuleType

    The type of NAT rule for VPN NAT.

    resourceGroupName string

    The resource group name of the Virtual Network Gateway.

    virtualNetworkGatewayName string

    The name of the gateway.

    externalMappings VpnNatRuleMappingArgs[]

    The private IP address external mapping for NAT.

    id string

    Resource ID.

    internalMappings VpnNatRuleMappingArgs[]

    The private IP address internal mapping for NAT.

    ipConfigurationId string

    The IP Configuration ID this NAT rule applies to.

    mode string | VpnNatRuleMode

    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.

    natRuleName string

    The name of the nat rule.

    type string | VpnNatRuleType

    The type of NAT rule for VPN NAT.

    resource_group_name str

    The resource group name of the Virtual Network Gateway.

    virtual_network_gateway_name str

    The name of the gateway.

    external_mappings Sequence[VpnNatRuleMappingArgs]

    The private IP address external mapping for NAT.

    id str

    Resource ID.

    internal_mappings Sequence[VpnNatRuleMappingArgs]

    The private IP address internal mapping for NAT.

    ip_configuration_id str

    The IP Configuration ID this NAT rule applies to.

    mode str | VpnNatRuleMode

    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_name str

    The name of the nat rule.

    type str | VpnNatRuleType

    The type of NAT rule for VPN NAT.

    resourceGroupName String

    The resource group name of the Virtual Network Gateway.

    virtualNetworkGatewayName String

    The name of the gateway.

    externalMappings List<Property Map>

    The private IP address external mapping for NAT.

    id String

    Resource ID.

    internalMappings List<Property Map>

    The private IP address internal mapping for NAT.

    ipConfigurationId String

    The IP Configuration ID this NAT rule applies to.

    mode String | "EgressSnat" | "IngressSnat"

    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.

    natRuleName String

    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.

    ProvisioningState 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.

    ProvisioningState 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.

    provisioningState 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.

    provisioningState 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.

    provisioningState String

    The provisioning state of the NAT Rule resource.

    Supporting Types

    VpnNatRuleMapping

    AddressSpace string

    Address space for Vpn NatRule mapping.

    AddressSpace string

    Address space for Vpn NatRule mapping.

    addressSpace String

    Address space for Vpn NatRule mapping.

    addressSpace string

    Address space for Vpn NatRule mapping.

    address_space str

    Address space for Vpn NatRule mapping.

    addressSpace String

    Address space for Vpn NatRule mapping.

    VpnNatRuleMappingResponse

    AddressSpace string

    Address space for Vpn NatRule mapping.

    AddressSpace string

    Address space for Vpn NatRule mapping.

    addressSpace String

    Address space for Vpn NatRule mapping.

    addressSpace string

    Address space for Vpn NatRule mapping.

    address_space str

    Address space for Vpn NatRule mapping.

    addressSpace String

    Address space for Vpn NatRule mapping.

    VpnNatRuleMode

    EgressSnat
    EgressSnat
    IngressSnat
    IngressSnat
    VpnNatRuleModeEgressSnat
    EgressSnat
    VpnNatRuleModeIngressSnat
    IngressSnat
    EgressSnat
    EgressSnat
    IngressSnat
    IngressSnat
    EgressSnat
    EgressSnat
    IngressSnat
    IngressSnat
    EGRESS_SNAT
    EgressSnat
    INGRESS_SNAT
    IngressSnat
    "EgressSnat"
    EgressSnat
    "IngressSnat"
    IngressSnat

    VpnNatRuleType

    Static
    Static
    Dynamic
    Dynamic
    VpnNatRuleTypeStatic
    Static
    VpnNatRuleTypeDynamic
    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/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/natRules/natRule1 
    

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    Azure Native v1.103.0 published on Friday, Jun 2, 2023 by Pulumi