nsxt 3.9.0 published on Friday, Jun 20, 2025 by vmware
nsxt.getVpcNat
Explore with Pulumi AI
This data source provides information about an NAT section configured under VPC 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 vpc1 = proj.then(proj => nsxt.getVpc({
context: {
projectId: proj.id,
},
displayName: "vpc1",
}));
const test = Promise.all([proj, vpc1]).then(([proj, vpc1]) => nsxt.getVpcNat({
context: {
projectId: proj.id,
vpcId: vpc1.id,
},
natType: "USER",
}));
import pulumi
import pulumi_nsxt as nsxt
proj = nsxt.get_policy_project(display_name="demoproj")
vpc1 = nsxt.get_vpc(context={
"project_id": proj.id,
},
display_name="vpc1")
test = nsxt.get_vpc_nat(context={
"project_id": proj.id,
"vpc_id": vpc1.id,
},
nat_type="USER")
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
}
vpc1, err := nsxt.LookupVpc(ctx, &nsxt.LookupVpcArgs{
Context: nsxt.GetVpcContext{
ProjectId: proj.Id,
},
DisplayName: pulumi.StringRef("vpc1"),
}, nil)
if err != nil {
return err
}
_, err = nsxt.GetVpcNat(ctx, &nsxt.GetVpcNatArgs{
Context: nsxt.GetVpcNatContext{
ProjectId: proj.Id,
VpcId: vpc1.Id,
},
NatType: "USER",
}, 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 vpc1 = Nsxt.GetVpc.Invoke(new()
{
Context = new Nsxt.Inputs.GetVpcContextInputArgs
{
ProjectId = proj.Apply(getPolicyProjectResult => getPolicyProjectResult.Id),
},
DisplayName = "vpc1",
});
var test = Nsxt.GetVpcNat.Invoke(new()
{
Context = new Nsxt.Inputs.GetVpcNatContextInputArgs
{
ProjectId = proj.Apply(getPolicyProjectResult => getPolicyProjectResult.Id),
VpcId = vpc1.Apply(getVpcResult => getVpcResult.Id),
},
NatType = "USER",
});
});
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.GetVpcArgs;
import com.pulumi.nsxt.inputs.GetVpcContextArgs;
import com.pulumi.nsxt.inputs.GetVpcNatArgs;
import com.pulumi.nsxt.inputs.GetVpcNatContextArgs;
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 vpc1 = NsxtFunctions.getVpc(GetVpcArgs.builder()
.context(GetVpcContextArgs.builder()
.projectId(proj.applyValue(getPolicyProjectResult -> getPolicyProjectResult.id()))
.build())
.displayName("vpc1")
.build());
final var test = NsxtFunctions.getVpcNat(GetVpcNatArgs.builder()
.context(GetVpcNatContextArgs.builder()
.projectId(proj.applyValue(getPolicyProjectResult -> getPolicyProjectResult.id()))
.vpcId(vpc1.applyValue(getVpcResult -> getVpcResult.id()))
.build())
.natType("USER")
.build());
}
}
variables:
proj:
fn::invoke:
function: nsxt:getPolicyProject
arguments:
displayName: demoproj
vpc1:
fn::invoke:
function: nsxt:getVpc
arguments:
context:
projectId: ${proj.id}
displayName: vpc1
test:
fn::invoke:
function: nsxt:getVpcNat
arguments:
context:
projectId: ${proj.id}
vpcId: ${vpc1.id}
natType: USER
Using getVpcNat
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 getVpcNat(args: GetVpcNatArgs, opts?: InvokeOptions): Promise<GetVpcNatResult>
function getVpcNatOutput(args: GetVpcNatOutputArgs, opts?: InvokeOptions): Output<GetVpcNatResult>
def get_vpc_nat(context: Optional[GetVpcNatContext] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
id: Optional[str] = None,
nat_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcNatResult
def get_vpc_nat_output(context: Optional[pulumi.Input[GetVpcNatContextArgs]] = None,
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,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcNatResult]
func GetVpcNat(ctx *Context, args *GetVpcNatArgs, opts ...InvokeOption) (*GetVpcNatResult, error)
func GetVpcNatOutput(ctx *Context, args *GetVpcNatOutputArgs, opts ...InvokeOption) GetVpcNatResultOutput
> Note: This function is named GetVpcNat
in the Go SDK.
public static class GetVpcNat
{
public static Task<GetVpcNatResult> InvokeAsync(GetVpcNatArgs args, InvokeOptions? opts = null)
public static Output<GetVpcNatResult> Invoke(GetVpcNatInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpcNatResult> getVpcNat(GetVpcNatArgs args, InvokeOptions options)
public static Output<GetVpcNatResult> getVpcNat(GetVpcNatArgs args, InvokeOptions options)
fn::invoke:
function: nsxt:index/getVpcNat:getVpcNat
arguments:
# arguments dictionary
The following arguments are supported:
- Context
Get
Vpc Nat Context - The context which the object belongs to
- Nat
Type string - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - Description string
- The description of the resource.
- Display
Name string - (Optional) Display Name of the resource.
- Id string
- (Optional) The ID of the resource.
- Context
Get
Vpc Nat Context - The context which the object belongs to
- Nat
Type string - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - Description string
- The description of the resource.
- Display
Name string - (Optional) Display Name of the resource.
- Id string
- (Optional) The ID of the resource.
- context
Get
Vpc Nat Context - The context which the object belongs to
- nat
Type String - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - description String
- The description of the resource.
- display
Name String - (Optional) Display Name of the resource.
- id String
- (Optional) The ID of the resource.
- context
Get
Vpc Nat Context - The context which the object belongs to
- nat
Type string - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - description string
- The description of the resource.
- display
Name string - (Optional) Display Name of the resource.
- id string
- (Optional) The ID of the resource.
- context
Get
Vpc Nat Context - The context which the object belongs to
- nat_
type str - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - description str
- The description of the resource.
- display_
name str - (Optional) Display Name of the resource.
- id str
- (Optional) The ID of the resource.
- context Property Map
- The context which the object belongs to
- nat
Type String - Type of NAT, one of
USER
,INTERNAL
,DEFAULT
orNAT64
. - description String
- The description of the resource.
- display
Name String - (Optional) Display Name of the resource.
- id String
- (Optional) The ID of the resource.
getVpcNat Result
The following output properties are available:
- Context
Get
Vpc Nat Context - Description string
- The description of the resource.
- Display
Name string - (Optional) Display Name of the resource.
- Id string
- (Optional) The ID of the resource.
- Nat
Type string - Path string
- The NSX path of the policy resource.
- Context
Get
Vpc Nat Context - Description string
- The description of the resource.
- Display
Name string - (Optional) Display Name of the resource.
- Id string
- (Optional) The ID of the resource.
- Nat
Type string - Path string
- The NSX path of the policy resource.
- context
Get
Vpc Nat Context - description String
- The description of the resource.
- display
Name String - (Optional) Display Name of the resource.
- id String
- (Optional) The ID of the resource.
- nat
Type String - path String
- The NSX path of the policy resource.
- context
Get
Vpc Nat Context - description string
- The description of the resource.
- display
Name string - (Optional) Display Name of the resource.
- id string
- (Optional) The ID of the resource.
- nat
Type string - path string
- The NSX path of the policy resource.
- context
Get
Vpc Nat Context - 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 - path str
- The NSX path of the policy resource.
- context Property Map
- description String
- The description of the resource.
- display
Name String - (Optional) Display Name of the resource.
- id String
- (Optional) The ID of the resource.
- nat
Type String - path String
- The NSX path of the policy resource.
Supporting Types
GetVpcNatContext
- project_
id str - The ID of the project which the object belongs to
- vpc_
id str - The ID of the VPC which the object belongs to
Package Details
- Repository
- nsxt vmware/terraform-provider-nsxt
- License
- Notes
- This Pulumi package is based on the
nsxt
Terraform Provider.