1. Packages
  2. Vcd Provider
  3. API Docs
  4. getNsxtNatRule
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getNsxtNatRule

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Supported in provider v3.3+ and VCD 10.1+ with NSX-T backed VDCs.

    Provides a data source to read NSX-T NAT rules. Source NAT (SNAT) rules change the source IP address from a private to a public IP address. Destination NAT (DNAT) rules change the destination IP address from a public to a private IP address.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const dnat_ssh = vcd.getNsxtNatRule({
        org: "my-org",
        edgeGatewayId: data.vcd_nsxt_edgegateway.existing.id,
        name: "dnat-ssh",
    });
    
    import pulumi
    import pulumi_vcd as vcd
    
    dnat_ssh = vcd.get_nsxt_nat_rule(org="my-org",
        edge_gateway_id=data["vcd_nsxt_edgegateway"]["existing"]["id"],
        name="dnat-ssh")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vcd.LookupNsxtNatRule(ctx, &vcd.LookupNsxtNatRuleArgs{
    			Org:           pulumi.StringRef("my-org"),
    			EdgeGatewayId: data.Vcd_nsxt_edgegateway.Existing.Id,
    			Name:          "dnat-ssh",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var dnat_ssh = Vcd.GetNsxtNatRule.Invoke(new()
        {
            Org = "my-org",
            EdgeGatewayId = data.Vcd_nsxt_edgegateway.Existing.Id,
            Name = "dnat-ssh",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.VcdFunctions;
    import com.pulumi.vcd.inputs.GetNsxtNatRuleArgs;
    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) {
            final var dnat-ssh = VcdFunctions.getNsxtNatRule(GetNsxtNatRuleArgs.builder()
                .org("my-org")
                .edgeGatewayId(data.vcd_nsxt_edgegateway().existing().id())
                .name("dnat-ssh")
                .build());
    
        }
    }
    
    variables:
      dnat-ssh:
        fn::invoke:
          function: vcd:getNsxtNatRule
          arguments:
            org: my-org
            edgeGatewayId: ${data.vcd_nsxt_edgegateway.existing.id}
            name: dnat-ssh
    

    Using getNsxtNatRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNsxtNatRule(args: GetNsxtNatRuleArgs, opts?: InvokeOptions): Promise<GetNsxtNatRuleResult>
    function getNsxtNatRuleOutput(args: GetNsxtNatRuleOutputArgs, opts?: InvokeOptions): Output<GetNsxtNatRuleResult>
    def get_nsxt_nat_rule(edge_gateway_id: Optional[str] = None,
                          id: Optional[str] = None,
                          name: Optional[str] = None,
                          org: Optional[str] = None,
                          vdc: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetNsxtNatRuleResult
    def get_nsxt_nat_rule_output(edge_gateway_id: Optional[pulumi.Input[str]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          org: Optional[pulumi.Input[str]] = None,
                          vdc: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetNsxtNatRuleResult]
    func LookupNsxtNatRule(ctx *Context, args *LookupNsxtNatRuleArgs, opts ...InvokeOption) (*LookupNsxtNatRuleResult, error)
    func LookupNsxtNatRuleOutput(ctx *Context, args *LookupNsxtNatRuleOutputArgs, opts ...InvokeOption) LookupNsxtNatRuleResultOutput

    > Note: This function is named LookupNsxtNatRule in the Go SDK.

    public static class GetNsxtNatRule 
    {
        public static Task<GetNsxtNatRuleResult> InvokeAsync(GetNsxtNatRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetNsxtNatRuleResult> Invoke(GetNsxtNatRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNsxtNatRuleResult> getNsxtNatRule(GetNsxtNatRuleArgs args, InvokeOptions options)
    public static Output<GetNsxtNatRuleResult> getNsxtNatRule(GetNsxtNatRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxtNatRule:getNsxtNatRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EdgeGatewayId string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    Name string

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    Id string
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    Vdc string

    Deprecated: Deprecated

    EdgeGatewayId string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    Name string

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    Id string
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    Vdc string

    Deprecated: Deprecated

    edgeGatewayId String
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name String

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    id String
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    vdc String

    Deprecated: Deprecated

    edgeGatewayId string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name string

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    id string
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    vdc string

    Deprecated: Deprecated

    edge_gateway_id str
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name str

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    id str
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    vdc str

    Deprecated: Deprecated

    edgeGatewayId String
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name String

    Name of existing NAT Rule.

    Name uniqueness is not enforced in NSX-T NAT rules, but for this data source to work properly names should be unique so that they can be distinguished.

    id String
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organizations.
    vdc String

    Deprecated: Deprecated

    getNsxtNatRule Result

    The following output properties are available:

    AppPortProfileId string
    Description string
    DnatExternalPort string
    EdgeGatewayId string
    Enabled bool
    ExternalAddress string
    FirewallMatch string
    Id string
    InternalAddress string
    Logging bool
    Name string
    Priority double
    RuleType string
    SnatDestinationAddress string
    Org string
    Vdc string

    Deprecated: Deprecated

    AppPortProfileId string
    Description string
    DnatExternalPort string
    EdgeGatewayId string
    Enabled bool
    ExternalAddress string
    FirewallMatch string
    Id string
    InternalAddress string
    Logging bool
    Name string
    Priority float64
    RuleType string
    SnatDestinationAddress string
    Org string
    Vdc string

    Deprecated: Deprecated

    appPortProfileId String
    description String
    dnatExternalPort String
    edgeGatewayId String
    enabled Boolean
    externalAddress String
    firewallMatch String
    id String
    internalAddress String
    logging Boolean
    name String
    priority Double
    ruleType String
    snatDestinationAddress String
    org String
    vdc String

    Deprecated: Deprecated

    appPortProfileId string
    description string
    dnatExternalPort string
    edgeGatewayId string
    enabled boolean
    externalAddress string
    firewallMatch string
    id string
    internalAddress string
    logging boolean
    name string
    priority number
    ruleType string
    snatDestinationAddress string
    org string
    vdc string

    Deprecated: Deprecated

    appPortProfileId String
    description String
    dnatExternalPort String
    edgeGatewayId String
    enabled Boolean
    externalAddress String
    firewallMatch String
    id String
    internalAddress String
    logging Boolean
    name String
    priority Number
    ruleType String
    snatDestinationAddress String
    org String
    vdc String

    Deprecated: Deprecated

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware