confluentcloud.SubjectMode
Explore with Pulumi AI
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 example = new confluentcloud.SubjectMode("example", {
schemaRegistryCluster: {
id: essentials.id,
},
restEndpoint: essentials.restEndpoint,
subjectName: "proto-purchase-value",
mode: "READONLY",
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>",
},
});
import pulumi
import pulumi_confluentcloud as confluentcloud
example = confluentcloud.SubjectMode("example",
schema_registry_cluster={
"id": essentials["id"],
},
rest_endpoint=essentials["restEndpoint"],
subject_name="proto-purchase-value",
mode="READONLY",
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>",
})
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.NewSubjectMode(ctx, "example", &confluentcloud.SubjectModeArgs{
SchemaRegistryCluster: &confluentcloud.SubjectModeSchemaRegistryClusterArgs{
Id: pulumi.Any(essentials.Id),
},
RestEndpoint: pulumi.Any(essentials.RestEndpoint),
SubjectName: pulumi.String("proto-purchase-value"),
Mode: pulumi.String("READONLY"),
Credentials: &confluentcloud.SubjectModeCredentialsArgs{
Key: pulumi.String("<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>"),
Secret: pulumi.String("<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() =>
{
var example = new ConfluentCloud.SubjectMode("example", new()
{
SchemaRegistryCluster = new ConfluentCloud.Inputs.SubjectModeSchemaRegistryClusterArgs
{
Id = essentials.Id,
},
RestEndpoint = essentials.RestEndpoint,
SubjectName = "proto-purchase-value",
Mode = "READONLY",
Credentials = new ConfluentCloud.Inputs.SubjectModeCredentialsArgs
{
Key = "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
Secret = "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.SubjectMode;
import com.pulumi.confluentcloud.SubjectModeArgs;
import com.pulumi.confluentcloud.inputs.SubjectModeSchemaRegistryClusterArgs;
import com.pulumi.confluentcloud.inputs.SubjectModeCredentialsArgs;
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) {
var example = new SubjectMode("example", SubjectModeArgs.builder()
.schemaRegistryCluster(SubjectModeSchemaRegistryClusterArgs.builder()
.id(essentials.id())
.build())
.restEndpoint(essentials.restEndpoint())
.subjectName("proto-purchase-value")
.mode("READONLY")
.credentials(SubjectModeCredentialsArgs.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());
}
}
resources:
example:
type: confluentcloud:SubjectMode
properties:
schemaRegistryCluster:
id: ${essentials.id}
restEndpoint: ${essentials.restEndpoint}
subjectName: proto-purchase-value
mode: READONLY
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>
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 example = new confluentcloud.SubjectMode("example", {
subjectName: "proto-purchase-value",
mode: "READONLY",
});
import pulumi
import pulumi_confluentcloud as confluentcloud
example = confluentcloud.SubjectMode("example",
subject_name="proto-purchase-value",
mode="READONLY")
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.NewSubjectMode(ctx, "example", &confluentcloud.SubjectModeArgs{
SubjectName: pulumi.String("proto-purchase-value"),
Mode: pulumi.String("READONLY"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() =>
{
var example = new ConfluentCloud.SubjectMode("example", new()
{
SubjectName = "proto-purchase-value",
Mode = "READONLY",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.SubjectMode;
import com.pulumi.confluentcloud.SubjectModeArgs;
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) {
var example = new SubjectMode("example", SubjectModeArgs.builder()
.subjectName("proto-purchase-value")
.mode("READONLY")
.build());
}
}
resources:
example:
type: confluentcloud:SubjectMode
properties:
subjectName: proto-purchase-value
mode: READONLY
Create SubjectMode Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SubjectMode(name: string, args: SubjectModeArgs, opts?: CustomResourceOptions);
@overload
def SubjectMode(resource_name: str,
args: SubjectModeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SubjectMode(resource_name: str,
opts: Optional[ResourceOptions] = None,
subject_name: Optional[str] = None,
credentials: Optional[SubjectModeCredentialsArgs] = None,
mode: Optional[str] = None,
rest_endpoint: Optional[str] = None,
schema_registry_cluster: Optional[SubjectModeSchemaRegistryClusterArgs] = None)
func NewSubjectMode(ctx *Context, name string, args SubjectModeArgs, opts ...ResourceOption) (*SubjectMode, error)
public SubjectMode(string name, SubjectModeArgs args, CustomResourceOptions? opts = null)
public SubjectMode(String name, SubjectModeArgs args)
public SubjectMode(String name, SubjectModeArgs args, CustomResourceOptions options)
type: confluentcloud:SubjectMode
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SubjectModeArgs
- 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 SubjectModeArgs
- 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 SubjectModeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubjectModeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SubjectModeArgs
- 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 subjectModeResource = new ConfluentCloud.SubjectMode("subjectModeResource", new()
{
SubjectName = "string",
Credentials = new ConfluentCloud.Inputs.SubjectModeCredentialsArgs
{
Key = "string",
Secret = "string",
},
Mode = "string",
RestEndpoint = "string",
SchemaRegistryCluster = new ConfluentCloud.Inputs.SubjectModeSchemaRegistryClusterArgs
{
Id = "string",
},
});
example, err := confluentcloud.NewSubjectMode(ctx, "subjectModeResource", &confluentcloud.SubjectModeArgs{
SubjectName: pulumi.String("string"),
Credentials: &confluentcloud.SubjectModeCredentialsArgs{
Key: pulumi.String("string"),
Secret: pulumi.String("string"),
},
Mode: pulumi.String("string"),
RestEndpoint: pulumi.String("string"),
SchemaRegistryCluster: &confluentcloud.SubjectModeSchemaRegistryClusterArgs{
Id: pulumi.String("string"),
},
})
var subjectModeResource = new SubjectMode("subjectModeResource", SubjectModeArgs.builder()
.subjectName("string")
.credentials(SubjectModeCredentialsArgs.builder()
.key("string")
.secret("string")
.build())
.mode("string")
.restEndpoint("string")
.schemaRegistryCluster(SubjectModeSchemaRegistryClusterArgs.builder()
.id("string")
.build())
.build());
subject_mode_resource = confluentcloud.SubjectMode("subjectModeResource",
subject_name="string",
credentials={
"key": "string",
"secret": "string",
},
mode="string",
rest_endpoint="string",
schema_registry_cluster={
"id": "string",
})
const subjectModeResource = new confluentcloud.SubjectMode("subjectModeResource", {
subjectName: "string",
credentials: {
key: "string",
secret: "string",
},
mode: "string",
restEndpoint: "string",
schemaRegistryCluster: {
id: "string",
},
});
type: confluentcloud:SubjectMode
properties:
credentials:
key: string
secret: string
mode: string
restEndpoint: string
schemaRegistryCluster:
id: string
subjectName: string
SubjectMode 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 SubjectMode resource accepts the following input properties:
- 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
. - Credentials
Pulumi.
Confluent Cloud. Inputs. Subject Mode Credentials - The Cluster API Credentials.
- Mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - 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. 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
. - Credentials
Subject
Mode Credentials Args - The Cluster API Credentials.
- Mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry SubjectCluster Mode Schema Registry Cluster Args
- 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
. - credentials
Subject
Mode Credentials - The Cluster API Credentials.
- mode String
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry SubjectCluster 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
. - credentials
Subject
Mode Credentials - The Cluster API Credentials.
- mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry SubjectCluster 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
. - credentials
Subject
Mode Credentials Args - The Cluster API Credentials.
- mode str
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest_
endpoint str - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema_
registry_ Subjectcluster Mode Schema Registry Cluster Args
- 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
. - credentials Property Map
- The Cluster API Credentials.
- mode String
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - 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
Outputs
All input properties are implicitly available as output properties. Additionally, the SubjectMode 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 str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing SubjectMode Resource
Get an existing SubjectMode 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?: SubjectModeState, opts?: CustomResourceOptions): SubjectMode
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
credentials: Optional[SubjectModeCredentialsArgs] = None,
mode: Optional[str] = None,
rest_endpoint: Optional[str] = None,
schema_registry_cluster: Optional[SubjectModeSchemaRegistryClusterArgs] = None,
subject_name: Optional[str] = None) -> SubjectMode
func GetSubjectMode(ctx *Context, name string, id IDInput, state *SubjectModeState, opts ...ResourceOption) (*SubjectMode, error)
public static SubjectMode Get(string name, Input<string> id, SubjectModeState? state, CustomResourceOptions? opts = null)
public static SubjectMode get(String name, Output<String> id, SubjectModeState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Credentials
Pulumi.
Confluent Cloud. Inputs. Subject Mode Credentials - The Cluster API Credentials.
- Mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - 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. 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
.
- Credentials
Subject
Mode Credentials Args - The Cluster API Credentials.
- Mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry SubjectCluster Mode Schema Registry Cluster Args - 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
.
- credentials
Subject
Mode Credentials - The Cluster API Credentials.
- mode String
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry SubjectCluster 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
.
- credentials
Subject
Mode Credentials - The Cluster API Credentials.
- mode string
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry SubjectCluster 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
.
- credentials
Subject
Mode Credentials Args - The Cluster API Credentials.
- mode str
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - rest_
endpoint str - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema_
registry_ Subjectcluster Mode Schema Registry Cluster Args - 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
.
- credentials Property Map
- The Cluster API Credentials.
- mode String
- The mode of the specified subject. Accepted values are:
READWRITE
,READONLY
,READONLY_OVERRIDE
, andIMPORT
. - 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 - 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
.
Supporting Types
SubjectModeCredentials, SubjectModeCredentialsArgs
SubjectModeSchemaRegistryCluster, SubjectModeSchemaRegistryClusterArgs
- 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
.
Import
You can import a Subject Mode by using the Schema Registry cluster ID, Subject name in the format <Schema Registry cluster ID>/<Subject name>
, for example:
$ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"
$ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"
$ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"
$ pulumi import confluentcloud:index/subjectMode:SubjectMode example lsrc-abc123/test-subject
!> Warning: Do not forget to delete terminal command history afterwards for security purposes.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Confluent Cloud pulumi/pulumi-confluentcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
confluent
Terraform Provider.