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

nsxt.getPolicyTags

Explore with Pulumi AI

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

    This data source provides the list of tags with a particular scope.

    This data source is applicable to NSX Policy Manager.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const tags = nsxt.getPolicyTags({
        scope: "dev",
    });
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    tags = nsxt.get_policy_tags(scope="dev")
    
    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.GetPolicyTags(ctx, &nsxt.GetPolicyTagsArgs{
    			Scope: "dev",
    		}, 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 tags = Nsxt.GetPolicyTags.Invoke(new()
        {
            Scope = "dev",
        });
    
    });
    
    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.GetPolicyTagsArgs;
    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 tags = NsxtFunctions.getPolicyTags(GetPolicyTagsArgs.builder()
                .scope("dev")
                .build());
    
        }
    }
    
    variables:
      tags:
        fn::invoke:
          function: nsxt:getPolicyTags
          arguments:
            scope: dev
    

    Using getPolicyTags

    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 getPolicyTags(args: GetPolicyTagsArgs, opts?: InvokeOptions): Promise<GetPolicyTagsResult>
    function getPolicyTagsOutput(args: GetPolicyTagsOutputArgs, opts?: InvokeOptions): Output<GetPolicyTagsResult>
    def get_policy_tags(id: Optional[str] = None,
                        scope: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetPolicyTagsResult
    def get_policy_tags_output(id: Optional[pulumi.Input[str]] = None,
                        scope: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetPolicyTagsResult]
    func GetPolicyTags(ctx *Context, args *GetPolicyTagsArgs, opts ...InvokeOption) (*GetPolicyTagsResult, error)
    func GetPolicyTagsOutput(ctx *Context, args *GetPolicyTagsOutputArgs, opts ...InvokeOption) GetPolicyTagsResultOutput

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

    public static class GetPolicyTags 
    {
        public static Task<GetPolicyTagsResult> InvokeAsync(GetPolicyTagsArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyTagsResult> Invoke(GetPolicyTagsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyTagsResult> getPolicyTags(GetPolicyTagsArgs args, InvokeOptions options)
    public static Output<GetPolicyTagsResult> getPolicyTags(GetPolicyTagsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyTags:getPolicyTags
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Scope string
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    Id string
    Scope string
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    Id string
    scope String
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    id String
    scope string
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    id string
    scope str
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    id str
    scope String
    The scope of the tags to retrieve. Supports starts with, ends with, equals, and contains filters. Use * as a suffix for "starts with" and a prefix for "ends with". For "contains," wrap the value with *. Use * alone to fetch all tags, irrespective scope.
    id String

    getPolicyTags Result

    The following output properties are available:

    Id string
    Items List<string>
    List of tags with the scope given in the argument.
    Scope string
    Id string
    Items []string
    List of tags with the scope given in the argument.
    Scope string
    id String
    items List<String>
    List of tags with the scope given in the argument.
    scope String
    id string
    items string[]
    List of tags with the scope given in the argument.
    scope string
    id str
    items Sequence[str]
    List of tags with the scope given in the argument.
    scope str
    id String
    items List<String>
    List of tags with the scope given in the argument.
    scope 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.8.1 published on Wednesday, Apr 30, 2025 by vmware