1. Packages
  2. Nsxt Provider
  3. API Docs
  4. getPolicyTier1Gateway
nsxt 3.8.0 published on Monday, Apr 14, 2025 by vmware

nsxt.getPolicyTier1Gateway

Explore with Pulumi AI

This data source provides information about policy Tier-1s configured on NSX.

This data source is applicable to NSX Policy Manager, NSX Global Manager and VMC.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";

const tier1Router = nsxt.getPolicyTier1Gateway({
    displayName: "tier1_gw",
});
Copy
import pulumi
import pulumi_nsxt as nsxt

tier1_router = nsxt.get_policy_tier1_gateway(display_name="tier1_gw")
Copy
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 {
		_, err := nsxt.LookupPolicyTier1Gateway(ctx, &nsxt.LookupPolicyTier1GatewayArgs{
			DisplayName: pulumi.StringRef("tier1_gw"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nsxt = Pulumi.Nsxt;

return await Deployment.RunAsync(() => 
{
    var tier1Router = Nsxt.GetPolicyTier1Gateway.Invoke(new()
    {
        DisplayName = "tier1_gw",
    });

});
Copy
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.GetPolicyTier1GatewayArgs;
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 tier1Router = NsxtFunctions.getPolicyTier1Gateway(GetPolicyTier1GatewayArgs.builder()
            .displayName("tier1_gw")
            .build());

    }
}
Copy
variables:
  tier1Router:
    fn::invoke:
      function: nsxt:getPolicyTier1Gateway
      arguments:
        displayName: tier1_gw
Copy

Multi-Tenancy

import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";

const demoproj = nsxt.getPolicyProject({
    displayName: "demoproj",
});
const demotier1 = demoproj.then(demoproj => nsxt.getPolicyTier1Gateway({
    context: {
        projectId: demoproj.id,
    },
    displayName: "demotier1",
}));
Copy
import pulumi
import pulumi_nsxt as nsxt

demoproj = nsxt.get_policy_project(display_name="demoproj")
demotier1 = nsxt.get_policy_tier1_gateway(context={
        "project_id": demoproj.id,
    },
    display_name="demotier1")
Copy
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 {
		demoproj, err := nsxt.LookupPolicyProject(ctx, &nsxt.LookupPolicyProjectArgs{
			DisplayName: pulumi.StringRef("demoproj"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = nsxt.LookupPolicyTier1Gateway(ctx, &nsxt.LookupPolicyTier1GatewayArgs{
			Context: nsxt.GetPolicyTier1GatewayContext{
				ProjectId: demoproj.Id,
			},
			DisplayName: pulumi.StringRef("demotier1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nsxt = Pulumi.Nsxt;

return await Deployment.RunAsync(() => 
{
    var demoproj = Nsxt.GetPolicyProject.Invoke(new()
    {
        DisplayName = "demoproj",
    });

    var demotier1 = Nsxt.GetPolicyTier1Gateway.Invoke(new()
    {
        Context = new Nsxt.Inputs.GetPolicyTier1GatewayContextInputArgs
        {
            ProjectId = demoproj.Apply(getPolicyProjectResult => getPolicyProjectResult.Id),
        },
        DisplayName = "demotier1",
    });

});
Copy
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.GetPolicyTier1GatewayArgs;
import com.pulumi.nsxt.inputs.GetPolicyTier1GatewayContextArgs;
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 demoproj = NsxtFunctions.getPolicyProject(GetPolicyProjectArgs.builder()
            .displayName("demoproj")
            .build());

        final var demotier1 = NsxtFunctions.getPolicyTier1Gateway(GetPolicyTier1GatewayArgs.builder()
            .context(GetPolicyTier1GatewayContextArgs.builder()
                .projectId(demoproj.applyValue(getPolicyProjectResult -> getPolicyProjectResult.id()))
                .build())
            .displayName("demotier1")
            .build());

    }
}
Copy
variables:
  demoproj:
    fn::invoke:
      function: nsxt:getPolicyProject
      arguments:
        displayName: demoproj
  demotier1:
    fn::invoke:
      function: nsxt:getPolicyTier1Gateway
      arguments:
        context:
          projectId: ${demoproj.id}
        displayName: demotier1
Copy

Using getPolicyTier1Gateway

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 getPolicyTier1Gateway(args: GetPolicyTier1GatewayArgs, opts?: InvokeOptions): Promise<GetPolicyTier1GatewayResult>
function getPolicyTier1GatewayOutput(args: GetPolicyTier1GatewayOutputArgs, opts?: InvokeOptions): Output<GetPolicyTier1GatewayResult>
Copy
def get_policy_tier1_gateway(context: Optional[GetPolicyTier1GatewayContext] = None,
                             description: Optional[str] = None,
                             display_name: Optional[str] = None,
                             edge_cluster_path: Optional[str] = None,
                             id: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetPolicyTier1GatewayResult
def get_policy_tier1_gateway_output(context: Optional[pulumi.Input[GetPolicyTier1GatewayContextArgs]] = None,
                             description: Optional[pulumi.Input[str]] = None,
                             display_name: Optional[pulumi.Input[str]] = None,
                             edge_cluster_path: Optional[pulumi.Input[str]] = None,
                             id: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetPolicyTier1GatewayResult]
Copy
func LookupPolicyTier1Gateway(ctx *Context, args *LookupPolicyTier1GatewayArgs, opts ...InvokeOption) (*LookupPolicyTier1GatewayResult, error)
func LookupPolicyTier1GatewayOutput(ctx *Context, args *LookupPolicyTier1GatewayOutputArgs, opts ...InvokeOption) LookupPolicyTier1GatewayResultOutput
Copy

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

public static class GetPolicyTier1Gateway 
{
    public static Task<GetPolicyTier1GatewayResult> InvokeAsync(GetPolicyTier1GatewayArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicyTier1GatewayResult> Invoke(GetPolicyTier1GatewayInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPolicyTier1GatewayResult> getPolicyTier1Gateway(GetPolicyTier1GatewayArgs args, InvokeOptions options)
public static Output<GetPolicyTier1GatewayResult> getPolicyTier1Gateway(GetPolicyTier1GatewayArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: nsxt:index/getPolicyTier1Gateway:getPolicyTier1Gateway
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Context GetPolicyTier1GatewayContext
The context which the object belongs to
Description string
The description of the resource.
DisplayName string
The Display Name prefix of the Tier-1 gateway to retrieve.
EdgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
Id string
The ID of Tier-1 gateway to retrieve.
Context GetPolicyTier1GatewayContext
The context which the object belongs to
Description string
The description of the resource.
DisplayName string
The Display Name prefix of the Tier-1 gateway to retrieve.
EdgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
Id string
The ID of Tier-1 gateway to retrieve.
context GetPolicyTier1GatewayContext
The context which the object belongs to
description String
The description of the resource.
displayName String
The Display Name prefix of the Tier-1 gateway to retrieve.
edgeClusterPath String
The path of the Edge cluster where this Tier-1 gateway is placed.
id String
The ID of Tier-1 gateway to retrieve.
context GetPolicyTier1GatewayContext
The context which the object belongs to
description string
The description of the resource.
displayName string
The Display Name prefix of the Tier-1 gateway to retrieve.
edgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
id string
The ID of Tier-1 gateway to retrieve.
context GetPolicyTier1GatewayContext
The context which the object belongs to
description str
The description of the resource.
display_name str
The Display Name prefix of the Tier-1 gateway to retrieve.
edge_cluster_path str
The path of the Edge cluster where this Tier-1 gateway is placed.
id str
The ID of Tier-1 gateway to retrieve.
context Property Map
The context which the object belongs to
description String
The description of the resource.
displayName String
The Display Name prefix of the Tier-1 gateway to retrieve.
edgeClusterPath String
The path of the Edge cluster where this Tier-1 gateway is placed.
id String
The ID of Tier-1 gateway to retrieve.

getPolicyTier1Gateway Result

The following output properties are available:

Description string
The description of the resource.
DisplayName string
EdgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
Id string
Path string
The NSX path of the policy resource.
Context GetPolicyTier1GatewayContext
Description string
The description of the resource.
DisplayName string
EdgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
Id string
Path string
The NSX path of the policy resource.
Context GetPolicyTier1GatewayContext
description String
The description of the resource.
displayName String
edgeClusterPath String
The path of the Edge cluster where this Tier-1 gateway is placed.
id String
path String
The NSX path of the policy resource.
context GetPolicyTier1GatewayContext
description string
The description of the resource.
displayName string
edgeClusterPath string
The path of the Edge cluster where this Tier-1 gateway is placed.
id string
path string
The NSX path of the policy resource.
context GetPolicyTier1GatewayContext
description str
The description of the resource.
display_name str
edge_cluster_path str
The path of the Edge cluster where this Tier-1 gateway is placed.
id str
path str
The NSX path of the policy resource.
context GetPolicyTier1GatewayContext
description String
The description of the resource.
displayName String
edgeClusterPath String
The path of the Edge cluster where this Tier-1 gateway is placed.
id String
path String
The NSX path of the policy resource.
context Property Map

Supporting Types

GetPolicyTier1GatewayContext

ProjectId This property is required. string
The ID of the project which the object belongs to
ProjectId This property is required. string
The ID of the project which the object belongs to
projectId This property is required. String
The ID of the project which the object belongs to
projectId This property is required. string
The ID of the project which the object belongs to
project_id This property is required. str
The ID of the project which the object belongs to
projectId This property is required. String
The ID of the project 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.