1. Packages
  2. Nsxt Provider
  3. API Docs
  4. getPolicyTransitGatewayNat
nsxt 3.9.0 published on Friday, Jun 20, 2025 by vmware

nsxt.getPolicyTransitGatewayNat

Explore with Pulumi AI

nsxt logo
nsxt 3.9.0 published on Friday, Jun 20, 2025 by vmware

    This data source provides information about an NAT section configured under Transit Gateway on NSX.

    This data source is applicable to NSX Policy Manager.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const proj = nsxt.getPolicyProject({
        displayName: "demoproj",
    });
    const tgw1 = proj.then(proj => nsxt.getPolicyTransitGateway({
        context: {
            projectId: proj.id,
        },
        displayName: "TGW1",
    }));
    const test = tgw1.then(tgw1 => nsxt.getPolicyTransitGatewayNat({
        transitGatewayPath: tgw1.path,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    proj = nsxt.get_policy_project(display_name="demoproj")
    tgw1 = nsxt.get_policy_transit_gateway(context={
            "project_id": proj.id,
        },
        display_name="TGW1")
    test = nsxt.get_policy_transit_gateway_nat(transit_gateway_path=tgw1.path)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		proj, err := nsxt.LookupPolicyProject(ctx, &nsxt.LookupPolicyProjectArgs{
    			DisplayName: pulumi.StringRef("demoproj"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		tgw1, err := nsxt.LookupPolicyTransitGateway(ctx, &nsxt.LookupPolicyTransitGatewayArgs{
    			Context: nsxt.GetPolicyTransitGatewayContext{
    				ProjectId: proj.Id,
    			},
    			DisplayName: pulumi.StringRef("TGW1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nsxt.GetPolicyTransitGatewayNat(ctx, &nsxt.GetPolicyTransitGatewayNatArgs{
    			TransitGatewayPath: tgw1.Path,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        var proj = Nsxt.GetPolicyProject.Invoke(new()
        {
            DisplayName = "demoproj",
        });
    
        var tgw1 = Nsxt.GetPolicyTransitGateway.Invoke(new()
        {
            Context = new Nsxt.Inputs.GetPolicyTransitGatewayContextInputArgs
            {
                ProjectId = proj.Apply(getPolicyProjectResult => getPolicyProjectResult.Id),
            },
            DisplayName = "TGW1",
        });
    
        var test = Nsxt.GetPolicyTransitGatewayNat.Invoke(new()
        {
            TransitGatewayPath = tgw1.Apply(getPolicyTransitGatewayResult => getPolicyTransitGatewayResult.Path),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nsxt.NsxtFunctions;
    import com.pulumi.nsxt.inputs.GetPolicyProjectArgs;
    import com.pulumi.nsxt.inputs.GetPolicyTransitGatewayArgs;
    import com.pulumi.nsxt.inputs.GetPolicyTransitGatewayContextArgs;
    import com.pulumi.nsxt.inputs.GetPolicyTransitGatewayNatArgs;
    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 proj = NsxtFunctions.getPolicyProject(GetPolicyProjectArgs.builder()
                .displayName("demoproj")
                .build());
    
            final var tgw1 = NsxtFunctions.getPolicyTransitGateway(GetPolicyTransitGatewayArgs.builder()
                .context(GetPolicyTransitGatewayContextArgs.builder()
                    .projectId(proj.applyValue(getPolicyProjectResult -> getPolicyProjectResult.id()))
                    .build())
                .displayName("TGW1")
                .build());
    
            final var test = NsxtFunctions.getPolicyTransitGatewayNat(GetPolicyTransitGatewayNatArgs.builder()
                .transitGatewayPath(tgw1.applyValue(getPolicyTransitGatewayResult -> getPolicyTransitGatewayResult.path()))
                .build());
    
        }
    }
    
    variables:
      proj:
        fn::invoke:
          function: nsxt:getPolicyProject
          arguments:
            displayName: demoproj
      tgw1:
        fn::invoke:
          function: nsxt:getPolicyTransitGateway
          arguments:
            context:
              projectId: ${proj.id}
            displayName: TGW1
      test:
        fn::invoke:
          function: nsxt:getPolicyTransitGatewayNat
          arguments:
            transitGatewayPath: ${tgw1.path}
    

    Using getPolicyTransitGatewayNat

    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 getPolicyTransitGatewayNat(args: GetPolicyTransitGatewayNatArgs, opts?: InvokeOptions): Promise<GetPolicyTransitGatewayNatResult>
    function getPolicyTransitGatewayNatOutput(args: GetPolicyTransitGatewayNatOutputArgs, opts?: InvokeOptions): Output<GetPolicyTransitGatewayNatResult>
    def get_policy_transit_gateway_nat(description: Optional[str] = None,
                                       display_name: Optional[str] = None,
                                       id: Optional[str] = None,
                                       nat_type: Optional[str] = None,
                                       transit_gateway_path: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetPolicyTransitGatewayNatResult
    def get_policy_transit_gateway_nat_output(description: Optional[pulumi.Input[str]] = None,
                                       display_name: Optional[pulumi.Input[str]] = None,
                                       id: Optional[pulumi.Input[str]] = None,
                                       nat_type: Optional[pulumi.Input[str]] = None,
                                       transit_gateway_path: Optional[pulumi.Input[str]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetPolicyTransitGatewayNatResult]
    func GetPolicyTransitGatewayNat(ctx *Context, args *GetPolicyTransitGatewayNatArgs, opts ...InvokeOption) (*GetPolicyTransitGatewayNatResult, error)
    func GetPolicyTransitGatewayNatOutput(ctx *Context, args *GetPolicyTransitGatewayNatOutputArgs, opts ...InvokeOption) GetPolicyTransitGatewayNatResultOutput

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

    public static class GetPolicyTransitGatewayNat 
    {
        public static Task<GetPolicyTransitGatewayNatResult> InvokeAsync(GetPolicyTransitGatewayNatArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyTransitGatewayNatResult> Invoke(GetPolicyTransitGatewayNatInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyTransitGatewayNatResult> getPolicyTransitGatewayNat(GetPolicyTransitGatewayNatArgs args, InvokeOptions options)
    public static Output<GetPolicyTransitGatewayNatResult> getPolicyTransitGatewayNat(GetPolicyTransitGatewayNatArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyTransitGatewayNat:getPolicyTransitGatewayNat
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TransitGatewayPath string
    Policy path of parent Transit Gateway
    Description string
    The description of the resource.
    DisplayName string
    (Optional) Display Name of the resource.
    Id string
    (Optional) The ID of the resource.
    NatType string
    TransitGatewayPath string
    Policy path of parent Transit Gateway
    Description string
    The description of the resource.
    DisplayName string
    (Optional) Display Name of the resource.
    Id string
    (Optional) The ID of the resource.
    NatType string
    transitGatewayPath String
    Policy path of parent Transit Gateway
    description String
    The description of the resource.
    displayName String
    (Optional) Display Name of the resource.
    id String
    (Optional) The ID of the resource.
    natType String
    transitGatewayPath string
    Policy path of parent Transit Gateway
    description string
    The description of the resource.
    displayName string
    (Optional) Display Name of the resource.
    id string
    (Optional) The ID of the resource.
    natType string
    transit_gateway_path str
    Policy path of parent Transit Gateway
    description str
    The description of the resource.
    display_name str
    (Optional) Display Name of the resource.
    id str
    (Optional) The ID of the resource.
    nat_type str
    transitGatewayPath String
    Policy path of parent Transit Gateway
    description String
    The description of the resource.
    displayName String
    (Optional) Display Name of the resource.
    id String
    (Optional) The ID of the resource.
    natType String

    getPolicyTransitGatewayNat Result

    The following output properties are available:

    Description string
    The description of the resource.
    DisplayName string
    (Optional) Display Name of the resource.
    Id string
    (Optional) The ID of the resource.
    Path string
    The NSX path of the policy resource.
    TransitGatewayPath string
    NatType string
    Description string
    The description of the resource.
    DisplayName string
    (Optional) Display Name of the resource.
    Id string
    (Optional) The ID of the resource.
    Path string
    The NSX path of the policy resource.
    TransitGatewayPath string
    NatType string
    description String
    The description of the resource.
    displayName String
    (Optional) Display Name of the resource.
    id String
    (Optional) The ID of the resource.
    path String
    The NSX path of the policy resource.
    transitGatewayPath String
    natType String
    description string
    The description of the resource.
    displayName string
    (Optional) Display Name of the resource.
    id string
    (Optional) The ID of the resource.
    path string
    The NSX path of the policy resource.
    transitGatewayPath string
    natType string
    description str
    The description of the resource.
    display_name str
    (Optional) Display Name of the resource.
    id str
    (Optional) The ID of the resource.
    path str
    The NSX path of the policy resource.
    transit_gateway_path str
    nat_type str
    description String
    The description of the resource.
    displayName String
    (Optional) Display Name of the resource.
    id String
    (Optional) The ID of the resource.
    path String
    The NSX path of the policy resource.
    transitGatewayPath String
    natType String

    Package Details

    Repository
    nsxt vmware/terraform-provider-nsxt
    License
    Notes
    This Pulumi package is based on the nsxt Terraform Provider.
    nsxt logo
    nsxt 3.9.0 published on Friday, Jun 20, 2025 by vmware