1. Packages
  2. Confluent Provider
  3. API Docs
  4. getTag
Confluent v2.23.0 published on Tuesday, Apr 1, 2025 by Pulumi

confluentcloud.getTag

Explore with Pulumi AI

General Availability

confluentcloud.Tag describes a Tag data source.

Example Usage

Option #1: Manage multiple Schema Registry clusters in the same Pulumi Stack

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

const pii = confluentcloud.getTag({
    schemaRegistryCluster: {
        id: essentials.id,
    },
    restEndpoint: essentials.restEndpoint,
    credentials: {
        key: "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
        secret: "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
    },
    name: "PII",
});
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

pii = confluentcloud.get_tag(schema_registry_cluster={
        "id": essentials["id"],
    },
    rest_endpoint=essentials["restEndpoint"],
    credentials={
        "key": "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
        "secret": "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
    },
    name="PII")
Copy
package main

import (
	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := confluentcloud.LookupTag(ctx, &confluentcloud.LookupTagArgs{
			SchemaRegistryCluster: confluentcloud.GetTagSchemaRegistryCluster{
				Id: essentials.Id,
			},
			RestEndpoint: pulumi.StringRef(essentials.RestEndpoint),
			Credentials: confluentcloud.GetTagCredentials{
				Key:    "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
				Secret: "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
			},
			Name: "PII",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;

return await Deployment.RunAsync(() => 
{
    var pii = ConfluentCloud.GetTag.Invoke(new()
    {
        SchemaRegistryCluster = new ConfluentCloud.Inputs.GetTagSchemaRegistryClusterInputArgs
        {
            Id = essentials.Id,
        },
        RestEndpoint = essentials.RestEndpoint,
        Credentials = new ConfluentCloud.Inputs.GetTagCredentialsInputArgs
        {
            Key = "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
            Secret = "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
        },
        Name = "PII",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetTagArgs;
import com.pulumi.confluentcloud.inputs.GetTagSchemaRegistryClusterArgs;
import com.pulumi.confluentcloud.inputs.GetTagCredentialsArgs;
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 pii = ConfluentcloudFunctions.getTag(GetTagArgs.builder()
            .schemaRegistryCluster(GetTagSchemaRegistryClusterArgs.builder()
                .id(essentials.id())
                .build())
            .restEndpoint(essentials.restEndpoint())
            .credentials(GetTagCredentialsArgs.builder()
                .key("<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>")
                .secret("<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>")
                .build())
            .name("PII")
            .build());

    }
}
Copy
variables:
  pii:
    fn::invoke:
      function: confluentcloud:getTag
      arguments:
        schemaRegistryCluster:
          id: ${essentials.id}
        restEndpoint: ${essentials.restEndpoint}
        credentials:
          key: <Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>
          secret: <Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>
        name: PII
Copy

Option #2: Manage a single Schema Registry cluster in the same Pulumi Stack

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

const pii = confluentcloud.getTag({
    name: "PII",
});
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

pii = confluentcloud.get_tag(name="PII")
Copy
package main

import (
	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := confluentcloud.LookupTag(ctx, &confluentcloud.LookupTagArgs{
			Name: "PII",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;

return await Deployment.RunAsync(() => 
{
    var pii = ConfluentCloud.GetTag.Invoke(new()
    {
        Name = "PII",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetTagArgs;
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 pii = ConfluentcloudFunctions.getTag(GetTagArgs.builder()
            .name("PII")
            .build());

    }
}
Copy
variables:
  pii:
    fn::invoke:
      function: confluentcloud:getTag
      arguments:
        name: PII
Copy

Note: We also support schema_registry_rest_endpoint instead of catalog_rest_endpoint for the time being.

Using getTag

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 getTag(args: GetTagArgs, opts?: InvokeOptions): Promise<GetTagResult>
function getTagOutput(args: GetTagOutputArgs, opts?: InvokeOptions): Output<GetTagResult>
Copy
def get_tag(credentials: Optional[GetTagCredentials] = None,
            name: Optional[str] = None,
            rest_endpoint: Optional[str] = None,
            schema_registry_cluster: Optional[GetTagSchemaRegistryCluster] = None,
            opts: Optional[InvokeOptions] = None) -> GetTagResult
def get_tag_output(credentials: Optional[pulumi.Input[GetTagCredentialsArgs]] = None,
            name: Optional[pulumi.Input[str]] = None,
            rest_endpoint: Optional[pulumi.Input[str]] = None,
            schema_registry_cluster: Optional[pulumi.Input[GetTagSchemaRegistryClusterArgs]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetTagResult]
Copy
func LookupTag(ctx *Context, args *LookupTagArgs, opts ...InvokeOption) (*LookupTagResult, error)
func LookupTagOutput(ctx *Context, args *LookupTagOutputArgs, opts ...InvokeOption) LookupTagResultOutput
Copy

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

public static class GetTag 
{
    public static Task<GetTagResult> InvokeAsync(GetTagArgs args, InvokeOptions? opts = null)
    public static Output<GetTagResult> Invoke(GetTagInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTagResult> getTag(GetTagArgs args, InvokeOptions options)
public static Output<GetTagResult> getTag(GetTagArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: confluentcloud:index/getTag:getTag
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

Credentials Pulumi.ConfluentCloud.Inputs.GetTagCredentials
RestEndpoint string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
SchemaRegistryCluster Pulumi.ConfluentCloud.Inputs.GetTagSchemaRegistryCluster
Name This property is required. string

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

Credentials GetTagCredentials
RestEndpoint string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
SchemaRegistryCluster GetTagSchemaRegistryCluster
name This property is required. String

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

credentials GetTagCredentials
restEndpoint String
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster GetTagSchemaRegistryCluster
name This property is required. string

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

credentials GetTagCredentials
restEndpoint string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster GetTagSchemaRegistryCluster
name This property is required. str

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

credentials GetTagCredentials
rest_endpoint str
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schema_registry_cluster GetTagSchemaRegistryCluster
name This property is required. String

The name of the tag, for example, PII. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.

Note: A Schema Registry API key consists of a key and a secret. Schema Registry API keys are required to interact with Schema Registry clusters in Confluent Cloud. Each Schema Registry API key is valid for one specific Schema Registry cluster.

credentials Property Map
restEndpoint String
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster Property Map

getTag Result

The following output properties are available:

Description string
(Optional String) The description of the tag.
EntityTypes List<string>
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
Id string
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
Name string
Version int
(Optional Integer) The version, for example, 1.
Credentials Pulumi.ConfluentCloud.Outputs.GetTagCredentials
RestEndpoint string
SchemaRegistryCluster Pulumi.ConfluentCloud.Outputs.GetTagSchemaRegistryCluster
Description string
(Optional String) The description of the tag.
EntityTypes []string
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
Id string
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
Name string
Version int
(Optional Integer) The version, for example, 1.
Credentials GetTagCredentials
RestEndpoint string
SchemaRegistryCluster GetTagSchemaRegistryCluster
description String
(Optional String) The description of the tag.
entityTypes List<String>
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
id String
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
name String
version Integer
(Optional Integer) The version, for example, 1.
credentials GetTagCredentials
restEndpoint String
schemaRegistryCluster GetTagSchemaRegistryCluster
description string
(Optional String) The description of the tag.
entityTypes string[]
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
id string
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
name string
version number
(Optional Integer) The version, for example, 1.
credentials GetTagCredentials
restEndpoint string
schemaRegistryCluster GetTagSchemaRegistryCluster
description str
(Optional String) The description of the tag.
entity_types Sequence[str]
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
id str
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
name str
version int
(Optional Integer) The version, for example, 1.
credentials GetTagCredentials
rest_endpoint str
schema_registry_cluster GetTagSchemaRegistryCluster
description String
(Optional String) The description of the tag.
entityTypes List<String>
(Optional List of String) The entity types of the tag, this always returns ["cf_entity"].
id String
(Required String) The ID of the Tag, in the format <Schema Registry cluster ID>/<Tag name>, for example, lsrc-8wrx70/PII.
name String
version Number
(Optional Integer) The version, for example, 1.
credentials Property Map
restEndpoint String
schemaRegistryCluster Property Map

Supporting Types

GetTagCredentials

Key This property is required. string
The Schema Registry API Key.
Secret This property is required. string
The Schema Registry API Secret.
Key This property is required. string
The Schema Registry API Key.
Secret This property is required. string
The Schema Registry API Secret.
key This property is required. String
The Schema Registry API Key.
secret This property is required. String
The Schema Registry API Secret.
key This property is required. string
The Schema Registry API Key.
secret This property is required. string
The Schema Registry API Secret.
key This property is required. str
The Schema Registry API Key.
secret This property is required. str
The Schema Registry API Secret.
key This property is required. String
The Schema Registry API Key.
secret This property is required. String
The Schema Registry API Secret.

GetTagSchemaRegistryCluster

Id This property is required. string
The ID of the Schema Registry cluster, for example, lsrc-abc123.
Id This property is required. string
The ID of the Schema Registry cluster, for example, lsrc-abc123.
id This property is required. String
The ID of the Schema Registry cluster, for example, lsrc-abc123.
id This property is required. string
The ID of the Schema Registry cluster, for example, lsrc-abc123.
id This property is required. str
The ID of the Schema Registry cluster, for example, lsrc-abc123.
id This property is required. String
The ID of the Schema Registry cluster, for example, lsrc-abc123.

Package Details

Repository
Confluent Cloud pulumi/pulumi-confluentcloud
License
Apache-2.0
Notes
This Pulumi package is based on the confluent Terraform Provider.