1. Packages
  2. Packages
  3. Zscaler Private Access (ZPA)
  4. API Docs
  5. getTagKey
Viewing docs for Zscaler Private Access v1.0.4
published on Monday, Jun 29, 2026 by Zscaler
zpa logo
Viewing docs for Zscaler Private Access v1.0.4
published on Monday, Jun 29, 2026 by Zscaler

    Use the zpa_tag_key data source to get information about a tag key in Zscaler Private Access (ZPA).

    NOTE: This an Early Access feature.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as zpa from "@bdzscaler/pulumi-zpa";
    
    const _this = zpa.getTagNamespace({
        name: "Example Namespace",
    });
    const thisGetTagKey = _this.then(_this => zpa.getTagKey({
        name: "Environment",
        namespaceId: _this.id,
    }));
    export const zpaTagKey = thisGetTagKey;
    
    import pulumi
    import pulumi_zpa as zpa
    
    this = zpa.get_tag_namespace(name="Example Namespace")
    this_get_tag_key = zpa.get_tag_key(name="Environment",
        namespace_id=this.id)
    pulumi.export("zpaTagKey", this_get_tag_key)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/zscaler/pulumi-zpa/sdk/go/zpa"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		this, err := zpa.GetTagNamespace(ctx, &zpa.LookupTagNamespaceArgs{
    			Name: pulumi.StringRef("Example Namespace"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		thisGetTagKey, err := zpa.GetTagKey(ctx, &zpa.LookupTagKeyArgs{
    			Name:        pulumi.StringRef("Environment"),
    			NamespaceId: this.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("zpaTagKey", thisGetTagKey)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zpa = zscaler.PulumiPackage.Zpa;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Zpa.GetTagNamespace.Invoke(new()
        {
            Name = "Example Namespace",
        });
    
        var thisGetTagKey = Zpa.GetTagKey.Invoke(new()
        {
            Name = "Environment",
            NamespaceId = @this.Apply(getTagNamespaceResult => getTagNamespaceResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["zpaTagKey"] = thisGetTagKey,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.ZpaFunctions;
    import com.pulumi.zpa.inputs.GetTagNamespaceArgs;
    import com.pulumi.zpa.inputs.GetTagKeyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 this = ZpaFunctions.getTagNamespace(GetTagNamespaceArgs.builder()
                .name("Example Namespace")
                .build());
    
            final var thisGetTagKey = ZpaFunctions.getTagKey(GetTagKeyArgs.builder()
                .name("Environment")
                .namespaceId(this_.id())
                .build());
    
            ctx.export("zpaTagKey", thisGetTagKey);
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: zpa:getTagNamespace
          arguments:
            name: Example Namespace
      thisGetTagKey:
        fn::invoke:
          function: zpa:getTagKey
          arguments:
            name: Environment
            namespaceId: ${this.id}
    outputs:
      zpaTagKey: ${thisGetTagKey}
    
    pulumi {
      required_providers {
        zpa = {
          source = "pulumi/zpa"
        }
      }
    }
    
    data "zpa_gettagnamespace" "this" {
      name = "Example Namespace"
    }
    data "zpa_gettagkey" "thisGetTagKey" {
      name         = "Environment"
      namespace_id = data.zpa_gettagnamespace.this.id
    }
    
    output "zpaTagKey" {
      value = data.zpa_gettagkey.thisGetTagKey
    }
    

    Using getTagKey

    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 getTagKey(args: GetTagKeyArgs, opts?: InvokeOptions): Promise<GetTagKeyResult>
    function getTagKeyOutput(args: GetTagKeyOutputArgs, opts?: InvokeOptions): Output<GetTagKeyResult>
    def get_tag_key(id: Optional[str] = None,
                    microtenant_id: Optional[str] = None,
                    name: Optional[str] = None,
                    namespace_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetTagKeyResult
    def get_tag_key_output(id: pulumi.Input[Optional[str]] = None,
                    microtenant_id: pulumi.Input[Optional[str]] = None,
                    name: pulumi.Input[Optional[str]] = None,
                    namespace_id: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetTagKeyResult]
    func LookupTagKey(ctx *Context, args *LookupTagKeyArgs, opts ...InvokeOption) (*LookupTagKeyResult, error)
    func LookupTagKeyOutput(ctx *Context, args *LookupTagKeyOutputArgs, opts ...InvokeOption) LookupTagKeyResultOutput

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

    public static class GetTagKey 
    {
        public static Task<GetTagKeyResult> InvokeAsync(GetTagKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetTagKeyResult> Invoke(GetTagKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTagKeyResult> getTagKey(GetTagKeyArgs args, InvokeOptions options)
    public static Output<GetTagKeyResult> getTagKey(GetTagKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: zpa:index/getTagKey:getTagKey
      arguments:
        # arguments dictionary
    data "zpa_get_tag_key" "name" {
        # arguments
    }

    The following arguments are supported:

    NamespaceId string
    The ID of the tag namespace this key belongs to.
    Id string
    The ID of the tag key.
    MicrotenantId string

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    Name string
    The name of the tag key.
    NamespaceId string
    The ID of the tag namespace this key belongs to.
    Id string
    The ID of the tag key.
    MicrotenantId string

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    Name string
    The name of the tag key.
    namespace_id string
    The ID of the tag namespace this key belongs to.
    id string
    The ID of the tag key.
    microtenant_id string

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    name string
    The name of the tag key.
    namespaceId String
    The ID of the tag namespace this key belongs to.
    id String
    The ID of the tag key.
    microtenantId String

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    name String
    The name of the tag key.
    namespaceId string
    The ID of the tag namespace this key belongs to.
    id string
    The ID of the tag key.
    microtenantId string

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    name string
    The name of the tag key.
    namespace_id str
    The ID of the tag namespace this key belongs to.
    id str
    The ID of the tag key.
    microtenant_id str

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    name str
    The name of the tag key.
    namespaceId String
    The ID of the tag namespace this key belongs to.
    id String
    The ID of the tag key.
    microtenantId String

    The ID of the microtenant.

    NOTE: id and name are mutually exclusive but at least one must be provided.

    name String
    The name of the tag key.

    getTagKey Result

    The following output properties are available:

    CustomerId string
    The customer ID.
    Description string
    The description of the tag key.
    Enabled bool
    Whether the tag key is enabled.
    MicrotenantName string
    The name of the microtenant.
    NamespaceId string
    Origin string
    The origin of the tag key.
    TagValues List<zscaler.PulumiPackage.Zpa.Outputs.GetTagKeyTagValue>
    A list of tag values. Each element contains:
    Type string
    The type of the tag key.
    Id string
    The ID of the tag value.
    MicrotenantId string
    The ID of the microtenant.
    Name string
    The name of the tag value.
    CustomerId string
    The customer ID.
    Description string
    The description of the tag key.
    Enabled bool
    Whether the tag key is enabled.
    MicrotenantName string
    The name of the microtenant.
    NamespaceId string
    Origin string
    The origin of the tag key.
    TagValues []GetTagKeyTagValue
    A list of tag values. Each element contains:
    Type string
    The type of the tag key.
    Id string
    The ID of the tag value.
    MicrotenantId string
    The ID of the microtenant.
    Name string
    The name of the tag value.
    customer_id string
    The customer ID.
    description string
    The description of the tag key.
    enabled bool
    Whether the tag key is enabled.
    microtenant_name string
    The name of the microtenant.
    namespace_id string
    origin string
    The origin of the tag key.
    tag_values list(object)
    A list of tag values. Each element contains:
    type string
    The type of the tag key.
    id string
    The ID of the tag value.
    microtenant_id string
    The ID of the microtenant.
    name string
    The name of the tag value.
    customerId String
    The customer ID.
    description String
    The description of the tag key.
    enabled Boolean
    Whether the tag key is enabled.
    microtenantName String
    The name of the microtenant.
    namespaceId String
    origin String
    The origin of the tag key.
    tagValues List<GetTagKeyTagValue>
    A list of tag values. Each element contains:
    type String
    The type of the tag key.
    id String
    The ID of the tag value.
    microtenantId String
    The ID of the microtenant.
    name String
    The name of the tag value.
    customerId string
    The customer ID.
    description string
    The description of the tag key.
    enabled boolean
    Whether the tag key is enabled.
    microtenantName string
    The name of the microtenant.
    namespaceId string
    origin string
    The origin of the tag key.
    tagValues GetTagKeyTagValue[]
    A list of tag values. Each element contains:
    type string
    The type of the tag key.
    id string
    The ID of the tag value.
    microtenantId string
    The ID of the microtenant.
    name string
    The name of the tag value.
    customer_id str
    The customer ID.
    description str
    The description of the tag key.
    enabled bool
    Whether the tag key is enabled.
    microtenant_name str
    The name of the microtenant.
    namespace_id str
    origin str
    The origin of the tag key.
    tag_values Sequence[GetTagKeyTagValue]
    A list of tag values. Each element contains:
    type str
    The type of the tag key.
    id str
    The ID of the tag value.
    microtenant_id str
    The ID of the microtenant.
    name str
    The name of the tag value.
    customerId String
    The customer ID.
    description String
    The description of the tag key.
    enabled Boolean
    Whether the tag key is enabled.
    microtenantName String
    The name of the microtenant.
    namespaceId String
    origin String
    The origin of the tag key.
    tagValues List<Property Map>
    A list of tag values. Each element contains:
    type String
    The type of the tag key.
    id String
    The ID of the tag value.
    microtenantId String
    The ID of the microtenant.
    name String
    The name of the tag value.

    Supporting Types

    GetTagKeyTagValue

    Id string
    The ID of the tag key.
    Name string
    The name of the tag key.
    Id string
    The ID of the tag key.
    Name string
    The name of the tag key.
    id string
    The ID of the tag key.
    name string
    The name of the tag key.
    id String
    The ID of the tag key.
    name String
    The name of the tag key.
    id string
    The ID of the tag key.
    name string
    The name of the tag key.
    id str
    The ID of the tag key.
    name str
    The name of the tag key.
    id String
    The ID of the tag key.
    name String
    The name of the tag key.

    Package Details

    Repository
    zpa zscaler/pulumi-zpa
    License
    MIT
    Notes
    This Pulumi package is based on the zpa Terraform Provider.
    zpa logo
    Viewing docs for Zscaler Private Access v1.0.4
    published on Monday, Jun 29, 2026 by Zscaler

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial