confluentcloud.getSubjectMode
Explore with Pulumi AI
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:
- Subject
Name 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.
Confluent Cloud. Inputs. Get Subject Mode Credentials - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry Pulumi.Cluster Confluent Cloud. Inputs. Get Subject Mode Schema Registry Cluster
- Subject
Name 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
Get
Subject Mode Credentials - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry GetCluster Subject Mode Schema Registry Cluster
- subject
Name 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
Get
Subject Mode Credentials - rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry GetCluster Subject Mode Schema Registry Cluster
- subject
Name 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
Get
Subject Mode Credentials - rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry GetCluster Subject Mode Schema Registry Cluster
- 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
Get
Subject Mode Credentials - rest_
endpoint str - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema_
registry_ Getcluster Subject Mode Schema Registry Cluster
- subject
Name 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
- rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry Property MapCluster
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
, andIMPORT
. - Subject
Name string - Credentials
Pulumi.
Confluent Cloud. Outputs. Get Subject Mode Credentials - Rest
Endpoint string - Schema
Registry Pulumi.Cluster Confluent Cloud. Outputs. Get Subject Mode Schema Registry Cluster
- 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
, andIMPORT
. - Subject
Name string - Credentials
Get
Subject Mode Credentials - Rest
Endpoint string - Schema
Registry GetCluster Subject Mode Schema Registry Cluster
- 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
, andIMPORT
. - subject
Name String - credentials
Get
Subject Mode Credentials - rest
Endpoint String - schema
Registry GetCluster Subject Mode Schema Registry Cluster
- 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
, andIMPORT
. - subject
Name string - credentials
Get
Subject Mode Credentials - rest
Endpoint string - schema
Registry GetCluster Subject Mode Schema Registry Cluster
- 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
, andIMPORT
. - subject_
name str - credentials
Get
Subject Mode Credentials - rest_
endpoint str - schema_
registry_ Getcluster Subject Mode Schema Registry Cluster
- 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
, andIMPORT
. - subject
Name String - credentials Property Map
- rest
Endpoint String - schema
Registry Property MapCluster
Supporting Types
GetSubjectModeCredentials
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.