1. Packages
  2. Confluent Provider
  3. API Docs
  4. getSubjectMode
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

confluentcloud.getSubjectMode

Explore with Pulumi AI

confluentcloud logo
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

    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);
    
    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)
    
    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
    	})
    }
    
    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)),
        };
    });
    
    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());
        }
    }
    
    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}
    

    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);
    
    import pulumi
    import pulumi_confluentcloud as confluentcloud
    
    purchase_v1 = confluentcloud.get_subject_mode(subject_name="proto-purchase-value")
    pulumi.export("mode", purchase_v1.mode)
    
    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
    	})
    }
    
    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)),
        };
    });
    
    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());
        }
    }
    
    variables:
      purchase-v1:
        fn::invoke:
          Function: confluentcloud:getSubjectMode
          Arguments:
            subjectName: proto-purchase-value
    outputs:
      mode: ${["purchase-v1"].mode}
    

    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>
    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]
    func LookupSubjectMode(ctx *Context, args *LookupSubjectModeArgs, opts ...InvokeOption) (*LookupSubjectModeResult, error)
    func LookupSubjectModeOutput(ctx *Context, args *LookupSubjectModeOutputArgs, opts ...InvokeOption) LookupSubjectModeResultOutput

    > 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)
    }
    public static CompletableFuture<GetSubjectModeResult> getSubjectMode(GetSubjectModeArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: confluentcloud:index/getSubjectMode:getSubjectMode
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SubjectName 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 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 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 string
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    SchemaRegistryCluster GetSubjectModeSchemaRegistryCluster
    subjectName 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 String
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
    subjectName 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 string
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schemaRegistryCluster GetSubjectModeSchemaRegistryCluster
    subject_name 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 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 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 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 string
    The Schema Registry API Key.
    Secret string
    The Schema Registry API Secret.
    Key string
    The Schema Registry API Key.
    Secret string
    The Schema Registry API Secret.
    key String
    The Schema Registry API Key.
    secret String
    The Schema Registry API Secret.
    key string
    The Schema Registry API Key.
    secret string
    The Schema Registry API Secret.
    key str
    The Schema Registry API Key.
    secret str
    The Schema Registry API Secret.
    key String
    The Schema Registry API Key.
    secret String
    The Schema Registry API Secret.

    GetSubjectModeSchemaRegistryCluster

    Id string
    The ID of the Schema Registry cluster, for example, lsrc-abc123.
    Id string
    The ID of the Schema Registry cluster, for example, lsrc-abc123.
    id String
    The ID of the Schema Registry cluster, for example, lsrc-abc123.
    id string
    The ID of the Schema Registry cluster, for example, lsrc-abc123.
    id str
    The ID of the Schema Registry cluster, for example, lsrc-abc123.
    id 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.
    confluentcloud logo
    Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi