1. Packages
  2. Packages
  3. Zscaler Private Access (ZPA)
  4. API Docs
  5. TagKey
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

    The zpa_tag_key resource creates and manages tag keys within a tag namespace 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 = new zpa.TagNamespace("this", {
        name: "Example Namespace",
        description: "An example tag namespace",
        enabled: true,
    });
    const thisTagKey = new zpa.TagKey("this", {
        name: "Environment",
        description: "Environment tag key",
        enabled: true,
        namespaceId: _this.id,
        tagValues: [
            {
                name: "Production",
            },
            {
                name: "Staging",
            },
        ],
    });
    
    import pulumi
    import zscaler_pulumi_zpa as zpa
    
    this = zpa.TagNamespace("this",
        name="Example Namespace",
        description="An example tag namespace",
        enabled=True)
    this_tag_key = zpa.TagKey("this",
        name="Environment",
        description="Environment tag key",
        enabled=True,
        namespace_id=this.id,
        tag_values=[
            {
                "name": "Production",
            },
            {
                "name": "Staging",
            },
        ])
    
    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.NewTagNamespace(ctx, "this", &zpa.TagNamespaceArgs{
    			Name:        pulumi.String("Example Namespace"),
    			Description: pulumi.String("An example tag namespace"),
    			Enabled:     pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = zpa.NewTagKey(ctx, "this", &zpa.TagKeyArgs{
    			Name:        pulumi.String("Environment"),
    			Description: pulumi.String("Environment tag key"),
    			Enabled:     pulumi.Bool(true),
    			NamespaceId: this.ID(),
    			TagValues: zpa.TagKeyTagValueArray{
    				&zpa.TagKeyTagValueArgs{
    					Name: pulumi.String("Production"),
    				},
    				&zpa.TagKeyTagValueArgs{
    					Name: pulumi.String("Staging"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zpa = zscaler.PulumiPackage.Zpa;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Zpa.TagNamespace("this", new()
        {
            Name = "Example Namespace",
            Description = "An example tag namespace",
            Enabled = true,
        });
    
        var thisTagKey = new Zpa.TagKey("this", new()
        {
            Name = "Environment",
            Description = "Environment tag key",
            Enabled = true,
            NamespaceId = @this.Id,
            TagValues = new[]
            {
                new Zpa.Inputs.TagKeyTagValueArgs
                {
                    Name = "Production",
                },
                new Zpa.Inputs.TagKeyTagValueArgs
                {
                    Name = "Staging",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.TagNamespace;
    import com.pulumi.zpa.TagNamespaceArgs;
    import com.pulumi.zpa.TagKey;
    import com.pulumi.zpa.TagKeyArgs;
    import com.pulumi.zpa.inputs.TagKeyTagValueArgs;
    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) {
            var this_ = new TagNamespace("this", TagNamespaceArgs.builder()
                .name("Example Namespace")
                .description("An example tag namespace")
                .enabled(true)
                .build());
    
            var thisTagKey = new TagKey("thisTagKey", TagKeyArgs.builder()
                .name("Environment")
                .description("Environment tag key")
                .enabled(true)
                .namespaceId(this_.id())
                .tagValues(            
                    TagKeyTagValueArgs.builder()
                        .name("Production")
                        .build(),
                    TagKeyTagValueArgs.builder()
                        .name("Staging")
                        .build())
                .build());
    
        }
    }
    
    resources:
      this:
        type: zpa:TagNamespace
        properties:
          name: Example Namespace
          description: An example tag namespace
          enabled: true
      thisTagKey:
        type: zpa:TagKey
        name: this
        properties:
          name: Environment
          description: Environment tag key
          enabled: true
          namespaceId: ${this.id}
          tagValues:
            - name: Production
            - name: Staging
    
    pulumi {
      required_providers {
        zpa = {
          source = "pulumi/zpa"
        }
      }
    }
    
    resource "zpa_tagnamespace" "this" {
      name        = "Example Namespace"
      description = "An example tag namespace"
      enabled     = true
    }
    resource "zpa_tagkey" "this" {
      name         = "Environment"
      description  = "Environment tag key"
      enabled      = true
      namespace_id = zpa_tagnamespace.this.id
      tag_values {
        name = "Production"
      }
      tag_values {
        name = "Staging"
      }
    }
    

    Create TagKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TagKey(name: string, args: TagKeyArgs, opts?: CustomResourceOptions);
    @overload
    def TagKey(resource_name: str,
               args: TagKeyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def TagKey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               namespace_id: Optional[str] = None,
               description: Optional[str] = None,
               enabled: Optional[bool] = None,
               microtenant_id: Optional[str] = None,
               name: Optional[str] = None,
               origin: Optional[str] = None,
               tag_values: Optional[Sequence[TagKeyTagValueArgs]] = None,
               type: Optional[str] = None)
    func NewTagKey(ctx *Context, name string, args TagKeyArgs, opts ...ResourceOption) (*TagKey, error)
    public TagKey(string name, TagKeyArgs args, CustomResourceOptions? opts = null)
    public TagKey(String name, TagKeyArgs args)
    public TagKey(String name, TagKeyArgs args, CustomResourceOptions options)
    
    type: zpa:TagKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "zpa_tag_key" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TagKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TagKeyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TagKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TagKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TagKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var tagKeyResource = new Zpa.TagKey("tagKeyResource", new()
    {
        NamespaceId = "string",
        Description = "string",
        Enabled = false,
        MicrotenantId = "string",
        Name = "string",
        Origin = "string",
        TagValues = new[]
        {
            new Zpa.Inputs.TagKeyTagValueArgs
            {
                Name = "string",
                Id = "string",
            },
        },
        Type = "string",
    });
    
    example, err := zpa.NewTagKey(ctx, "tagKeyResource", &zpa.TagKeyArgs{
    	NamespaceId:   pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	Enabled:       pulumi.Bool(false),
    	MicrotenantId: pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	Origin:        pulumi.String("string"),
    	TagValues: zpa.TagKeyTagValueArray{
    		&zpa.TagKeyTagValueArgs{
    			Name: pulumi.String("string"),
    			Id:   pulumi.String("string"),
    		},
    	},
    	Type: pulumi.String("string"),
    })
    
    resource "zpa_tag_key" "tagKeyResource" {
      lifecycle {
        create_before_destroy = true
      }
      namespace_id   = "string"
      description    = "string"
      enabled        = false
      microtenant_id = "string"
      name           = "string"
      origin         = "string"
      tag_values {
        name = "string"
        id   = "string"
      }
      type = "string"
    }
    
    var tagKeyResource = new TagKey("tagKeyResource", TagKeyArgs.builder()
        .namespaceId("string")
        .description("string")
        .enabled(false)
        .microtenantId("string")
        .name("string")
        .origin("string")
        .tagValues(TagKeyTagValueArgs.builder()
            .name("string")
            .id("string")
            .build())
        .type("string")
        .build());
    
    tag_key_resource = zpa.TagKey("tagKeyResource",
        namespace_id="string",
        description="string",
        enabled=False,
        microtenant_id="string",
        name="string",
        origin="string",
        tag_values=[{
            "name": "string",
            "id": "string",
        }],
        type="string")
    
    const tagKeyResource = new zpa.TagKey("tagKeyResource", {
        namespaceId: "string",
        description: "string",
        enabled: false,
        microtenantId: "string",
        name: "string",
        origin: "string",
        tagValues: [{
            name: "string",
            id: "string",
        }],
        type: "string",
    });
    
    type: zpa:TagKey
    properties:
        description: string
        enabled: false
        microtenantId: string
        name: string
        namespaceId: string
        origin: string
        tagValues:
            - id: string
              name: string
        type: string
    

    TagKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The TagKey resource accepts the following input properties:

    NamespaceId string
    ID of the tag namespace this key belongs to
    Description string
    Description of the tag key
    Enabled bool
    Whether this tag key is enabled
    MicrotenantId string
    Microtenant ID
    Name string
    The name of the tag value.
    Origin string
    Origin of the tag key. Defaults to CUSTOM
    TagValues List<zscaler.PulumiPackage.Zpa.Inputs.TagKeyTagValue>
    The list of tag values. Each element contains:
    Type string
    Type of the tag key. Defaults to STATIC
    NamespaceId string
    ID of the tag namespace this key belongs to
    Description string
    Description of the tag key
    Enabled bool
    Whether this tag key is enabled
    MicrotenantId string
    Microtenant ID
    Name string
    The name of the tag value.
    Origin string
    Origin of the tag key. Defaults to CUSTOM
    TagValues []TagKeyTagValueArgs
    The list of tag values. Each element contains:
    Type string
    Type of the tag key. Defaults to STATIC
    namespace_id string
    ID of the tag namespace this key belongs to
    description string
    Description of the tag key
    enabled bool
    Whether this tag key is enabled
    microtenant_id string
    Microtenant ID
    name string
    The name of the tag value.
    origin string
    Origin of the tag key. Defaults to CUSTOM
    tag_values list(object)
    The list of tag values. Each element contains:
    type string
    Type of the tag key. Defaults to STATIC
    namespaceId String
    ID of the tag namespace this key belongs to
    description String
    Description of the tag key
    enabled Boolean
    Whether this tag key is enabled
    microtenantId String
    Microtenant ID
    name String
    The name of the tag value.
    origin String
    Origin of the tag key. Defaults to CUSTOM
    tagValues List<TagKeyTagValue>
    The list of tag values. Each element contains:
    type String
    Type of the tag key. Defaults to STATIC
    namespaceId string
    ID of the tag namespace this key belongs to
    description string
    Description of the tag key
    enabled boolean
    Whether this tag key is enabled
    microtenantId string
    Microtenant ID
    name string
    The name of the tag value.
    origin string
    Origin of the tag key. Defaults to CUSTOM
    tagValues TagKeyTagValue[]
    The list of tag values. Each element contains:
    type string
    Type of the tag key. Defaults to STATIC
    namespace_id str
    ID of the tag namespace this key belongs to
    description str
    Description of the tag key
    enabled bool
    Whether this tag key is enabled
    microtenant_id str
    Microtenant ID
    name str
    The name of the tag value.
    origin str
    Origin of the tag key. Defaults to CUSTOM
    tag_values Sequence[TagKeyTagValueArgs]
    The list of tag values. Each element contains:
    type str
    Type of the tag key. Defaults to STATIC
    namespaceId String
    ID of the tag namespace this key belongs to
    description String
    Description of the tag key
    enabled Boolean
    Whether this tag key is enabled
    microtenantId String
    Microtenant ID
    name String
    The name of the tag value.
    origin String
    Origin of the tag key. Defaults to CUSTOM
    tagValues List<Property Map>
    The list of tag values. Each element contains:
    type String
    Type of the tag key. Defaults to STATIC

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TagKey resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TagKey Resource

    Get an existing TagKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TagKeyState, opts?: CustomResourceOptions): TagKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            microtenant_id: Optional[str] = None,
            name: Optional[str] = None,
            namespace_id: Optional[str] = None,
            origin: Optional[str] = None,
            tag_values: Optional[Sequence[TagKeyTagValueArgs]] = None,
            type: Optional[str] = None) -> TagKey
    func GetTagKey(ctx *Context, name string, id IDInput, state *TagKeyState, opts ...ResourceOption) (*TagKey, error)
    public static TagKey Get(string name, Input<string> id, TagKeyState? state, CustomResourceOptions? opts = null)
    public static TagKey get(String name, Output<String> id, TagKeyState state, CustomResourceOptions options)
    resources:  _:    type: zpa:TagKey    get:      id: ${id}
    import {
      to = zpa_tag_key.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Description of the tag key
    Enabled bool
    Whether this tag key is enabled
    MicrotenantId string
    Microtenant ID
    Name string
    The name of the tag value.
    NamespaceId string
    ID of the tag namespace this key belongs to
    Origin string
    Origin of the tag key. Defaults to CUSTOM
    TagValues List<zscaler.PulumiPackage.Zpa.Inputs.TagKeyTagValue>
    The list of tag values. Each element contains:
    Type string
    Type of the tag key. Defaults to STATIC
    Description string
    Description of the tag key
    Enabled bool
    Whether this tag key is enabled
    MicrotenantId string
    Microtenant ID
    Name string
    The name of the tag value.
    NamespaceId string
    ID of the tag namespace this key belongs to
    Origin string
    Origin of the tag key. Defaults to CUSTOM
    TagValues []TagKeyTagValueArgs
    The list of tag values. Each element contains:
    Type string
    Type of the tag key. Defaults to STATIC
    description string
    Description of the tag key
    enabled bool
    Whether this tag key is enabled
    microtenant_id string
    Microtenant ID
    name string
    The name of the tag value.
    namespace_id string
    ID of the tag namespace this key belongs to
    origin string
    Origin of the tag key. Defaults to CUSTOM
    tag_values list(object)
    The list of tag values. Each element contains:
    type string
    Type of the tag key. Defaults to STATIC
    description String
    Description of the tag key
    enabled Boolean
    Whether this tag key is enabled
    microtenantId String
    Microtenant ID
    name String
    The name of the tag value.
    namespaceId String
    ID of the tag namespace this key belongs to
    origin String
    Origin of the tag key. Defaults to CUSTOM
    tagValues List<TagKeyTagValue>
    The list of tag values. Each element contains:
    type String
    Type of the tag key. Defaults to STATIC
    description string
    Description of the tag key
    enabled boolean
    Whether this tag key is enabled
    microtenantId string
    Microtenant ID
    name string
    The name of the tag value.
    namespaceId string
    ID of the tag namespace this key belongs to
    origin string
    Origin of the tag key. Defaults to CUSTOM
    tagValues TagKeyTagValue[]
    The list of tag values. Each element contains:
    type string
    Type of the tag key. Defaults to STATIC
    description str
    Description of the tag key
    enabled bool
    Whether this tag key is enabled
    microtenant_id str
    Microtenant ID
    name str
    The name of the tag value.
    namespace_id str
    ID of the tag namespace this key belongs to
    origin str
    Origin of the tag key. Defaults to CUSTOM
    tag_values Sequence[TagKeyTagValueArgs]
    The list of tag values. Each element contains:
    type str
    Type of the tag key. Defaults to STATIC
    description String
    Description of the tag key
    enabled Boolean
    Whether this tag key is enabled
    microtenantId String
    Microtenant ID
    name String
    The name of the tag value.
    namespaceId String
    ID of the tag namespace this key belongs to
    origin String
    Origin of the tag key. Defaults to CUSTOM
    tagValues List<Property Map>
    The list of tag values. Each element contains:
    type String
    Type of the tag key. Defaults to STATIC

    Supporting Types

    TagKeyTagValue, TagKeyTagValueArgs

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

    Import

    Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. Visit

    zpa_tag_key can be imported by using the composite format <NAMESPACE ID>/<TAG KEY ID> or <NAMESPACE ID>/<TAG KEY NAME> as the import ID.

    For example:

    $ pulumi import zpa:index/tagKey:TagKey example <namespace_id>/<tag_key_id>
    

    or

    $ pulumi import zpa:index/tagKey:TagKey example <namespace_id>/<tag_key_name>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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