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

confluentcloud.getSubjectMode

Explore with Pulumi AI

General Availability

confluentcloud.SubjectMode describes a Subject Mode 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 purchase_v1 = confluentcloud.getSubjectMode({
    schemaRegistryCluster: {
        id: essentials.id,
    },
    restEndpoint: essentials.restEndpoint,
    subjectName: "proto-purchase-value",
    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>",
    },
});
export const mode = purchase_v1.then(purchase_v1 => purchase_v1.mode);
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

purchase_v1 = confluentcloud.get_subject_mode(schema_registry_cluster={
        "id": essentials["id"],
    },
    rest_endpoint=essentials["restEndpoint"],
    subject_name="proto-purchase-value",
    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>",
    })
pulumi.export("mode", purchase_v1.mode)
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 {
		purchase_v1, err := confluentcloud.LookupSubjectMode(ctx, &confluentcloud.LookupSubjectModeArgs{
			SchemaRegistryCluster: confluentcloud.GetSubjectModeSchemaRegistryCluster{
				Id: essentials.Id,
			},
			RestEndpoint: pulumi.StringRef(essentials.RestEndpoint),
			SubjectName:  "proto-purchase-value",
			Credentials: confluentcloud.GetSubjectModeCredentials{
				Key:    "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
				Secret: "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mode", purchase_v1.Mode)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;

return await Deployment.RunAsync(() => 
{
    var purchase_v1 = ConfluentCloud.GetSubjectMode.Invoke(new()
    {
        SchemaRegistryCluster = new ConfluentCloud.Inputs.GetSubjectModeSchemaRegistryClusterInputArgs
        {
            Id = essentials.Id,
        },
        RestEndpoint = essentials.RestEndpoint,
        SubjectName = "proto-purchase-value",
        Credentials = new ConfluentCloud.Inputs.GetSubjectModeCredentialsInputArgs
        {
            Key = "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
            Secret = "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
        },
    });

    return new Dictionary<string, object?>
    {
        ["mode"] = purchase_v1.Apply(purchase_v1 => purchase_v1.Apply(getSubjectModeResult => getSubjectModeResult.Mode)),
    };
});
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.GetSubjectModeArgs;
import com.pulumi.confluentcloud.inputs.GetSubjectModeSchemaRegistryClusterArgs;
import com.pulumi.confluentcloud.inputs.GetSubjectModeCredentialsArgs;
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 purchase-v1 = ConfluentcloudFunctions.getSubjectMode(GetSubjectModeArgs.builder()
            .schemaRegistryCluster(GetSubjectModeSchemaRegistryClusterArgs.builder()
                .id(essentials.id())
                .build())
            .restEndpoint(essentials.restEndpoint())
            .subjectName("proto-purchase-value")
            .credentials(GetSubjectModeCredentialsArgs.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())
            .build());

        ctx.export("mode", purchase_v1.mode());
    }
}
Copy
variables:
  purchase-v1:
    fn::invoke:
      function: confluentcloud:getSubjectMode
      arguments:
        schemaRegistryCluster:
          id: ${essentials.id}
        restEndpoint: ${essentials.restEndpoint}
        subjectName: proto-purchase-value
        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>
outputs:
  mode: ${["purchase-v1"].mode}
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 purchase_v1 = confluentcloud.getSubjectMode({
    subjectName: "proto-purchase-value",
});
export const mode = purchase_v1.then(purchase_v1 => purchase_v1.mode);
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

purchase_v1 = confluentcloud.get_subject_mode(subject_name="proto-purchase-value")
pulumi.export("mode", purchase_v1.mode)
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 {
		purchase_v1, err := confluentcloud.LookupSubjectMode(ctx, &confluentcloud.LookupSubjectModeArgs{
			SubjectName: "proto-purchase-value",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mode", purchase_v1.Mode)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;

return await Deployment.RunAsync(() => 
{
    var purchase_v1 = ConfluentCloud.GetSubjectMode.Invoke(new()
    {
        SubjectName = "proto-purchase-value",
    });

    return new Dictionary<string, object?>
    {
        ["mode"] = purchase_v1.Apply(purchase_v1 => purchase_v1.Apply(getSubjectModeResult => getSubjectModeResult.Mode)),
    };
});
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.GetSubjectModeArgs;
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 purchase-v1 = ConfluentcloudFunctions.getSubjectMode(GetSubjectModeArgs.builder()
            .subjectName("proto-purchase-value")
            .build());

        ctx.export("mode", purchase_v1.mode());
    }
}
Copy
variables:
  purchase-v1:
    fn::invoke:
      function: confluentcloud:getSubjectMode
      arguments:
        subjectName: proto-purchase-value
outputs:
  mode: ${["purchase-v1"].mode}
Copy

Using getSubjectMode

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 getSubjectMode(args: GetSubjectModeArgs, opts?: InvokeOptions): Promise<GetSubjectModeResult>
function getSubjectModeOutput(args: GetSubjectModeOutputArgs, opts?: InvokeOptions): Output<GetSubjectModeResult>
Copy
def get_subject_mode(credentials: Optional[GetSubjectModeCredentials] = None,
                     rest_endpoint: Optional[str] = None,
                     schema_registry_cluster: Optional[GetSubjectModeSchemaRegistryCluster] = None,
                     subject_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetSubjectModeResult
def get_subject_mode_output(credentials: Optional[pulumi.Input[GetSubjectModeCredentialsArgs]] = None,
                     rest_endpoint: Optional[pulumi.Input[str]] = None,
                     schema_registry_cluster: Optional[pulumi.Input[GetSubjectModeSchemaRegistryClusterArgs]] = None,
                     subject_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetSubjectModeResult]
Copy
func LookupSubjectMode(ctx *Context, args *LookupSubjectModeArgs, opts ...InvokeOption) (*LookupSubjectModeResult, error)
func LookupSubjectModeOutput(ctx *Context, args *LookupSubjectModeOutputArgs, opts ...InvokeOption) LookupSubjectModeResultOutput
Copy

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

public static class GetSubjectMode 
{
    public static Task<GetSubjectModeResult> InvokeAsync(GetSubjectModeArgs args, InvokeOptions? opts = null)
    public static Output<GetSubjectModeResult> Invoke(GetSubjectModeInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubjectModeResult> getSubjectMode(GetSubjectModeArgs args, InvokeOptions options)
public static Output<GetSubjectModeResult> getSubjectMode(GetSubjectModeArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: confluentcloud:index/getSubjectMode:getSubjectMode
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

SubjectName This property is required. string

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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.GetSubjectModeCredentials
RestEndpoint Changes to this property will trigger replacement. string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
SchemaRegistryCluster Pulumi.ConfluentCloud.Inputs.GetSubjectModeSchemaRegistryCluster
SubjectName This property is required. string

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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 GetSubjectModeCredentials
RestEndpoint Changes to this property will trigger replacement. string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
SchemaRegistryCluster GetSubjectModeSchemaRegistryCluster
subjectName This property is required. String

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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 GetSubjectModeCredentials
restEndpoint Changes to this property will trigger replacement. String
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
subjectName This property is required. string

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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 GetSubjectModeCredentials
restEndpoint Changes to this property will trigger replacement. string
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
subject_name This property is required. str

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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 GetSubjectModeCredentials
rest_endpoint Changes to this property will trigger replacement. str
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schema_registry_cluster GetSubjectModeSchemaRegistryCluster
subjectName This property is required. String

The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, test-subject.

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 Changes to this property will trigger replacement. String
The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
schemaRegistryCluster Property Map

getSubjectMode Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Mode string
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
SubjectName string
Credentials Pulumi.ConfluentCloud.Outputs.GetSubjectModeCredentials
RestEndpoint string
SchemaRegistryCluster Pulumi.ConfluentCloud.Outputs.GetSubjectModeSchemaRegistryCluster
Id string
The provider-assigned unique ID for this managed resource.
Mode string
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
SubjectName string
Credentials GetSubjectModeCredentials
RestEndpoint string
SchemaRegistryCluster GetSubjectModeSchemaRegistryCluster
id String
The provider-assigned unique ID for this managed resource.
mode String
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
subjectName String
credentials GetSubjectModeCredentials
restEndpoint String
schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
id string
The provider-assigned unique ID for this managed resource.
mode string
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
subjectName string
credentials GetSubjectModeCredentials
restEndpoint string
schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
id str
The provider-assigned unique ID for this managed resource.
mode str
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
subject_name str
credentials GetSubjectModeCredentials
rest_endpoint str
schema_registry_cluster GetSubjectModeSchemaRegistryCluster
id String
The provider-assigned unique ID for this managed resource.
mode String
(Required String) The mode of the specified subject. Accepted values are: READWRITE, READONLY, READONLY_OVERRIDE, and IMPORT.
subjectName String
credentials Property Map
restEndpoint String
schemaRegistryCluster Property Map

Supporting Types

GetSubjectModeCredentials

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.

GetSubjectModeSchemaRegistryCluster

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.