1. Packages
  2. Nsxt Provider
  3. API Docs
  4. getPolicyRealizationInfo
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

nsxt.getPolicyRealizationInfo

Explore with Pulumi AI

nsxt logo
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

    This data source provides information about the realization of a policy resource on NSX manager. This data source will wait until realization is determined as either success or error. It is recommended to use this data source if further configuration depends on resource realization.

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const tier1Gw = nsxt.getPolicyTier1Gateway({
        displayName: "tier1_gw",
    });
    const info = tier1Gw.then(tier1Gw => nsxt.getPolicyRealizationInfo({
        path: tier1Gw.path,
        entityType: "RealizedLogicalRouter",
        timeout: 60,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    tier1_gw = nsxt.get_policy_tier1_gateway(display_name="tier1_gw")
    info = nsxt.get_policy_realization_info(path=tier1_gw.path,
        entity_type="RealizedLogicalRouter",
        timeout=60)
    
    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 {
    		tier1Gw, err := nsxt.LookupPolicyTier1Gateway(ctx, &nsxt.LookupPolicyTier1GatewayArgs{
    			DisplayName: pulumi.StringRef("tier1_gw"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nsxt.GetPolicyRealizationInfo(ctx, &nsxt.GetPolicyRealizationInfoArgs{
    			Path:       tier1Gw.Path,
    			EntityType: pulumi.StringRef("RealizedLogicalRouter"),
    			Timeout:    pulumi.Float64Ref(60),
    		}, 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 tier1Gw = Nsxt.GetPolicyTier1Gateway.Invoke(new()
        {
            DisplayName = "tier1_gw",
        });
    
        var info = Nsxt.GetPolicyRealizationInfo.Invoke(new()
        {
            Path = tier1Gw.Apply(getPolicyTier1GatewayResult => getPolicyTier1GatewayResult.Path),
            EntityType = "RealizedLogicalRouter",
            Timeout = 60,
        });
    
    });
    
    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 com.pulumi.nsxt.inputs.GetPolicyRealizationInfoArgs;
    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 tier1Gw = NsxtFunctions.getPolicyTier1Gateway(GetPolicyTier1GatewayArgs.builder()
                .displayName("tier1_gw")
                .build());
    
            final var info = NsxtFunctions.getPolicyRealizationInfo(GetPolicyRealizationInfoArgs.builder()
                .path(tier1Gw.applyValue(getPolicyTier1GatewayResult -> getPolicyTier1GatewayResult.path()))
                .entityType("RealizedLogicalRouter")
                .timeout(60)
                .build());
    
        }
    }
    
    variables:
      tier1Gw:
        fn::invoke:
          function: nsxt:getPolicyTier1Gateway
          arguments:
            displayName: tier1_gw
      info:
        fn::invoke:
          function: nsxt:getPolicyRealizationInfo
          arguments:
            path: ${tier1Gw.path}
            entityType: RealizedLogicalRouter
            timeout: 60
    

    Multi-Tenancy

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const demoproj = nsxt.getPolicyProject({
        displayName: "demoproj",
    });
    const tier1Gw = nsxt.getPolicyTier1Gateway({
        displayName: "tier1_gw",
    });
    const info = Promise.all([demoproj, tier1Gw]).then(([demoproj, tier1Gw]) => nsxt.getPolicyRealizationInfo({
        context: {
            projectId: demoproj.id,
        },
        path: tier1Gw.path,
        entityType: "RealizedLogicalRouter",
        timeout: 60,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    demoproj = nsxt.get_policy_project(display_name="demoproj")
    tier1_gw = nsxt.get_policy_tier1_gateway(display_name="tier1_gw")
    info = nsxt.get_policy_realization_info(context={
            "project_id": demoproj.id,
        },
        path=tier1_gw.path,
        entity_type="RealizedLogicalRouter",
        timeout=60)
    
    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
    		}
    		tier1Gw, err := nsxt.LookupPolicyTier1Gateway(ctx, &nsxt.LookupPolicyTier1GatewayArgs{
    			DisplayName: pulumi.StringRef("tier1_gw"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nsxt.GetPolicyRealizationInfo(ctx, &nsxt.GetPolicyRealizationInfoArgs{
    			Context: nsxt.GetPolicyRealizationInfoContext{
    				ProjectId: demoproj.Id,
    			},
    			Path:       tier1Gw.Path,
    			EntityType: pulumi.StringRef("RealizedLogicalRouter"),
    			Timeout:    pulumi.Float64Ref(60),
    		}, 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 demoproj = Nsxt.GetPolicyProject.Invoke(new()
        {
            DisplayName = "demoproj",
        });
    
        var tier1Gw = Nsxt.GetPolicyTier1Gateway.Invoke(new()
        {
            DisplayName = "tier1_gw",
        });
    
        var info = Nsxt.GetPolicyRealizationInfo.Invoke(new()
        {
            Context = new Nsxt.Inputs.GetPolicyRealizationInfoContextInputArgs
            {
                ProjectId = demoproj.Apply(getPolicyProjectResult => getPolicyProjectResult.Id),
            },
            Path = tier1Gw.Apply(getPolicyTier1GatewayResult => getPolicyTier1GatewayResult.Path),
            EntityType = "RealizedLogicalRouter",
            Timeout = 60,
        });
    
    });
    
    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.GetPolicyRealizationInfoArgs;
    import com.pulumi.nsxt.inputs.GetPolicyRealizationInfoContextArgs;
    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 tier1Gw = NsxtFunctions.getPolicyTier1Gateway(GetPolicyTier1GatewayArgs.builder()
                .displayName("tier1_gw")
                .build());
    
            final var info = NsxtFunctions.getPolicyRealizationInfo(GetPolicyRealizationInfoArgs.builder()
                .context(GetPolicyRealizationInfoContextArgs.builder()
                    .projectId(demoproj.applyValue(getPolicyProjectResult -> getPolicyProjectResult.id()))
                    .build())
                .path(tier1Gw.applyValue(getPolicyTier1GatewayResult -> getPolicyTier1GatewayResult.path()))
                .entityType("RealizedLogicalRouter")
                .timeout(60)
                .build());
    
        }
    }
    
    variables:
      demoproj:
        fn::invoke:
          function: nsxt:getPolicyProject
          arguments:
            displayName: demoproj
      tier1Gw:
        fn::invoke:
          function: nsxt:getPolicyTier1Gateway
          arguments:
            displayName: tier1_gw
      info:
        fn::invoke:
          function: nsxt:getPolicyRealizationInfo
          arguments:
            context:
              projectId: ${demoproj.id}
            path: ${tier1Gw.path}
            entityType: RealizedLogicalRouter
            timeout: 60
    

    Global Manager Example

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const tier1Gw = nsxt.getPolicyTier1Gateway({
        displayName: "tier1_gw",
    });
    const site = nsxt.getPolicySite({
        displayName: "Paris",
    });
    const info = Promise.all([tier1Gw, site]).then(([tier1Gw, site]) => nsxt.getPolicyRealizationInfo({
        path: tier1Gw.path,
        entityType: "RealizedLogicalRouter",
        sitePath: site.path,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    tier1_gw = nsxt.get_policy_tier1_gateway(display_name="tier1_gw")
    site = nsxt.get_policy_site(display_name="Paris")
    info = nsxt.get_policy_realization_info(path=tier1_gw.path,
        entity_type="RealizedLogicalRouter",
        site_path=site.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 {
    		tier1Gw, err := nsxt.LookupPolicyTier1Gateway(ctx, &nsxt.LookupPolicyTier1GatewayArgs{
    			DisplayName: pulumi.StringRef("tier1_gw"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		site, err := nsxt.LookupPolicySite(ctx, &nsxt.LookupPolicySiteArgs{
    			DisplayName: pulumi.StringRef("Paris"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nsxt.GetPolicyRealizationInfo(ctx, &nsxt.GetPolicyRealizationInfoArgs{
    			Path:       tier1Gw.Path,
    			EntityType: pulumi.StringRef("RealizedLogicalRouter"),
    			SitePath:   pulumi.StringRef(site.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 tier1Gw = Nsxt.GetPolicyTier1Gateway.Invoke(new()
        {
            DisplayName = "tier1_gw",
        });
    
        var site = Nsxt.GetPolicySite.Invoke(new()
        {
            DisplayName = "Paris",
        });
    
        var info = Nsxt.GetPolicyRealizationInfo.Invoke(new()
        {
            Path = tier1Gw.Apply(getPolicyTier1GatewayResult => getPolicyTier1GatewayResult.Path),
            EntityType = "RealizedLogicalRouter",
            SitePath = site.Apply(getPolicySiteResult => getPolicySiteResult.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.GetPolicyTier1GatewayArgs;
    import com.pulumi.nsxt.inputs.GetPolicySiteArgs;
    import com.pulumi.nsxt.inputs.GetPolicyRealizationInfoArgs;
    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 tier1Gw = NsxtFunctions.getPolicyTier1Gateway(GetPolicyTier1GatewayArgs.builder()
                .displayName("tier1_gw")
                .build());
    
            final var site = NsxtFunctions.getPolicySite(GetPolicySiteArgs.builder()
                .displayName("Paris")
                .build());
    
            final var info = NsxtFunctions.getPolicyRealizationInfo(GetPolicyRealizationInfoArgs.builder()
                .path(tier1Gw.applyValue(getPolicyTier1GatewayResult -> getPolicyTier1GatewayResult.path()))
                .entityType("RealizedLogicalRouter")
                .sitePath(site.applyValue(getPolicySiteResult -> getPolicySiteResult.path()))
                .build());
    
        }
    }
    
    variables:
      tier1Gw:
        fn::invoke:
          function: nsxt:getPolicyTier1Gateway
          arguments:
            displayName: tier1_gw
      site:
        fn::invoke:
          function: nsxt:getPolicySite
          arguments:
            displayName: Paris
      info:
        fn::invoke:
          function: nsxt:getPolicyRealizationInfo
          arguments:
            path: ${tier1Gw.path}
            entityType: RealizedLogicalRouter
            sitePath: ${site.path}
    

    Using getPolicyRealizationInfo

    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 getPolicyRealizationInfo(args: GetPolicyRealizationInfoArgs, opts?: InvokeOptions): Promise<GetPolicyRealizationInfoResult>
    function getPolicyRealizationInfoOutput(args: GetPolicyRealizationInfoOutputArgs, opts?: InvokeOptions): Output<GetPolicyRealizationInfoResult>
    def get_policy_realization_info(context: Optional[GetPolicyRealizationInfoContext] = None,
                                    delay: Optional[float] = None,
                                    entity_type: Optional[str] = None,
                                    id: Optional[str] = None,
                                    path: Optional[str] = None,
                                    site_path: Optional[str] = None,
                                    timeout: Optional[float] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetPolicyRealizationInfoResult
    def get_policy_realization_info_output(context: Optional[pulumi.Input[GetPolicyRealizationInfoContextArgs]] = None,
                                    delay: Optional[pulumi.Input[float]] = None,
                                    entity_type: Optional[pulumi.Input[str]] = None,
                                    id: Optional[pulumi.Input[str]] = None,
                                    path: Optional[pulumi.Input[str]] = None,
                                    site_path: Optional[pulumi.Input[str]] = None,
                                    timeout: Optional[pulumi.Input[float]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetPolicyRealizationInfoResult]
    func GetPolicyRealizationInfo(ctx *Context, args *GetPolicyRealizationInfoArgs, opts ...InvokeOption) (*GetPolicyRealizationInfoResult, error)
    func GetPolicyRealizationInfoOutput(ctx *Context, args *GetPolicyRealizationInfoOutputArgs, opts ...InvokeOption) GetPolicyRealizationInfoResultOutput

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

    public static class GetPolicyRealizationInfo 
    {
        public static Task<GetPolicyRealizationInfoResult> InvokeAsync(GetPolicyRealizationInfoArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyRealizationInfoResult> Invoke(GetPolicyRealizationInfoInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyRealizationInfoResult> getPolicyRealizationInfo(GetPolicyRealizationInfoArgs args, InvokeOptions options)
    public static Output<GetPolicyRealizationInfoResult> getPolicyRealizationInfo(GetPolicyRealizationInfoArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyRealizationInfo:getPolicyRealizationInfo
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Path string
    The policy path of the resource.
    Context GetPolicyRealizationInfoContext
    The context which the object belongs to
    Delay double
    Delay (in seconds) before realization polling is started. Default is set to 1.
    EntityType string
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    Id string
    SitePath string
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    Timeout double
    Timeout (in seconds) for realization polling. Default is set to 1200.
    Path string
    The policy path of the resource.
    Context GetPolicyRealizationInfoContext
    The context which the object belongs to
    Delay float64
    Delay (in seconds) before realization polling is started. Default is set to 1.
    EntityType string
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    Id string
    SitePath string
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    Timeout float64
    Timeout (in seconds) for realization polling. Default is set to 1200.
    path String
    The policy path of the resource.
    context GetPolicyRealizationInfoContext
    The context which the object belongs to
    delay Double
    Delay (in seconds) before realization polling is started. Default is set to 1.
    entityType String
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    id String
    sitePath String
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    timeout Double
    Timeout (in seconds) for realization polling. Default is set to 1200.
    path string
    The policy path of the resource.
    context GetPolicyRealizationInfoContext
    The context which the object belongs to
    delay number
    Delay (in seconds) before realization polling is started. Default is set to 1.
    entityType string
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    id string
    sitePath string
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    timeout number
    Timeout (in seconds) for realization polling. Default is set to 1200.
    path str
    The policy path of the resource.
    context GetPolicyRealizationInfoContext
    The context which the object belongs to
    delay float
    Delay (in seconds) before realization polling is started. Default is set to 1.
    entity_type str
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    id str
    site_path str
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    timeout float
    Timeout (in seconds) for realization polling. Default is set to 1200.
    path String
    The policy path of the resource.
    context Property Map
    The context which the object belongs to
    delay Number
    Delay (in seconds) before realization polling is started. Default is set to 1.
    entityType String
    The entity type of realized resource. If not set, on of the realized resources of the policy resource will be retrieved.
    id String
    sitePath String
    The path of the site which the resource belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    timeout Number
    Timeout (in seconds) for realization polling. Default is set to 1200.

    getPolicyRealizationInfo Result

    The following output properties are available:

    EntityType string
    Id string
    Path string
    RealizedId string
    The id of the realized object.
    State string
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    Context GetPolicyRealizationInfoContext
    Delay double
    SitePath string
    Timeout double
    EntityType string
    Id string
    Path string
    RealizedId string
    The id of the realized object.
    State string
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    Context GetPolicyRealizationInfoContext
    Delay float64
    SitePath string
    Timeout float64
    entityType String
    id String
    path String
    realizedId String
    The id of the realized object.
    state String
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    context GetPolicyRealizationInfoContext
    delay Double
    sitePath String
    timeout Double
    entityType string
    id string
    path string
    realizedId string
    The id of the realized object.
    state string
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    context GetPolicyRealizationInfoContext
    delay number
    sitePath string
    timeout number
    entity_type str
    id str
    path str
    realized_id str
    The id of the realized object.
    state str
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    context GetPolicyRealizationInfoContext
    delay float
    site_path str
    timeout float
    entityType String
    id String
    path String
    realizedId String
    The id of the realized object.
    state String
    The realization state of the resource: "REALIZED", "UNKNOWN", "UNREALIZED" or "ERROR".
    context Property Map
    delay Number
    sitePath String
    timeout Number

    Supporting Types

    GetPolicyRealizationInfoContext

    ProjectId string
    The ID of the project which the object belongs to
    ProjectId string
    The ID of the project which the object belongs to
    projectId String
    The ID of the project which the object belongs to
    projectId string
    The ID of the project which the object belongs to
    project_id str
    The ID of the project which the object belongs to
    projectId 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.
    nsxt logo
    nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware