digitalocean.DatabaseKafkaSchemaRegistry
Explore with Pulumi AI
Provides a DigitalOcean Kafka schema registry for Kafka clusters.
Example Usage
Create a new Kafka Schema Registry
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const kafka_example = new digitalocean.DatabaseCluster("kafka-example", {
name: "example-kafka-cluster",
engine: "kafka",
version: "3.5",
size: "gd-2vcpu-8gb",
region: digitalocean.Region.BLR1,
nodeCount: 3,
tags: ["production"],
});
const schema_01 = new digitalocean.DatabaseKafkaSchemaRegistry("schema-01", {
clusterId: kafka_example.id,
subjectName: "test-schema",
schemaType: "avro",
schema: `{
"type": "record",
"namespace": "example",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "value", "type": "int"}
]
}
`,
});
import pulumi
import pulumi_digitalocean as digitalocean
kafka_example = digitalocean.DatabaseCluster("kafka-example",
name="example-kafka-cluster",
engine="kafka",
version="3.5",
size="gd-2vcpu-8gb",
region=digitalocean.Region.BLR1,
node_count=3,
tags=["production"])
schema_01 = digitalocean.DatabaseKafkaSchemaRegistry("schema-01",
cluster_id=kafka_example.id,
subject_name="test-schema",
schema_type="avro",
schema="""{
"type": "record",
"namespace": "example",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "value", "type": "int"}
]
}
""")
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
kafka_example, err := digitalocean.NewDatabaseCluster(ctx, "kafka-example", &digitalocean.DatabaseClusterArgs{
Name: pulumi.String("example-kafka-cluster"),
Engine: pulumi.String("kafka"),
Version: pulumi.String("3.5"),
Size: pulumi.String("gd-2vcpu-8gb"),
Region: pulumi.String(digitalocean.RegionBLR1),
NodeCount: pulumi.Int(3),
Tags: pulumi.StringArray{
pulumi.String("production"),
},
})
if err != nil {
return err
}
_, err = digitalocean.NewDatabaseKafkaSchemaRegistry(ctx, "schema-01", &digitalocean.DatabaseKafkaSchemaRegistryArgs{
ClusterId: kafka_example.ID(),
SubjectName: pulumi.String("test-schema"),
SchemaType: pulumi.String("avro"),
Schema: pulumi.String(`{
"type": "record",
"namespace": "example",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "value", "type": "int"}
]
}
`),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var kafka_example = new DigitalOcean.DatabaseCluster("kafka-example", new()
{
Name = "example-kafka-cluster",
Engine = "kafka",
Version = "3.5",
Size = "gd-2vcpu-8gb",
Region = DigitalOcean.Region.BLR1,
NodeCount = 3,
Tags = new[]
{
"production",
},
});
var schema_01 = new DigitalOcean.DatabaseKafkaSchemaRegistry("schema-01", new()
{
ClusterId = kafka_example.Id,
SubjectName = "test-schema",
SchemaType = "avro",
Schema = @"{
""type"": ""record"",
""namespace"": ""example"",
""name"": ""TestRecord"",
""fields"": [
{""name"": ""id"", ""type"": ""string""},
{""name"": ""name"", ""type"": ""string""},
{""name"": ""value"", ""type"": ""int""}
]
}
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseKafkaSchemaRegistry;
import com.pulumi.digitalocean.DatabaseKafkaSchemaRegistryArgs;
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 kafka_example = new DatabaseCluster("kafka-example", DatabaseClusterArgs.builder()
.name("example-kafka-cluster")
.engine("kafka")
.version("3.5")
.size("gd-2vcpu-8gb")
.region("blr1")
.nodeCount(3)
.tags("production")
.build());
var schema_01 = new DatabaseKafkaSchemaRegistry("schema-01", DatabaseKafkaSchemaRegistryArgs.builder()
.clusterId(kafka_example.id())
.subjectName("test-schema")
.schemaType("avro")
.schema("""
{
"type": "record",
"namespace": "example",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "value", "type": "int"}
]
}
""")
.build());
}
}
resources:
schema-01:
type: digitalocean:DatabaseKafkaSchemaRegistry
properties:
clusterId: ${["kafka-example"].id}
subjectName: test-schema
schemaType: avro
schema: |
{
"type": "record",
"namespace": "example",
"name": "TestRecord",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "value", "type": "int"}
]
}
kafka-example:
type: digitalocean:DatabaseCluster
properties:
name: example-kafka-cluster
engine: kafka
version: '3.5'
size: gd-2vcpu-8gb
region: blr1
nodeCount: 3
tags:
- production
Create DatabaseKafkaSchemaRegistry Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseKafkaSchemaRegistry(name: string, args: DatabaseKafkaSchemaRegistryArgs, opts?: CustomResourceOptions);
@overload
def DatabaseKafkaSchemaRegistry(resource_name: str,
args: DatabaseKafkaSchemaRegistryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseKafkaSchemaRegistry(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
schema: Optional[str] = None,
schema_type: Optional[str] = None,
subject_name: Optional[str] = None)
func NewDatabaseKafkaSchemaRegistry(ctx *Context, name string, args DatabaseKafkaSchemaRegistryArgs, opts ...ResourceOption) (*DatabaseKafkaSchemaRegistry, error)
public DatabaseKafkaSchemaRegistry(string name, DatabaseKafkaSchemaRegistryArgs args, CustomResourceOptions? opts = null)
public DatabaseKafkaSchemaRegistry(String name, DatabaseKafkaSchemaRegistryArgs args)
public DatabaseKafkaSchemaRegistry(String name, DatabaseKafkaSchemaRegistryArgs args, CustomResourceOptions options)
type: digitalocean:DatabaseKafkaSchemaRegistry
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 DatabaseKafkaSchemaRegistryArgs
- 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 DatabaseKafkaSchemaRegistryArgs
- 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 DatabaseKafkaSchemaRegistryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseKafkaSchemaRegistryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseKafkaSchemaRegistryArgs
- 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 databaseKafkaSchemaRegistryResource = new DigitalOcean.DatabaseKafkaSchemaRegistry("databaseKafkaSchemaRegistryResource", new()
{
ClusterId = "string",
Schema = "string",
SchemaType = "string",
SubjectName = "string",
});
example, err := digitalocean.NewDatabaseKafkaSchemaRegistry(ctx, "databaseKafkaSchemaRegistryResource", &digitalocean.DatabaseKafkaSchemaRegistryArgs{
ClusterId: pulumi.String("string"),
Schema: pulumi.String("string"),
SchemaType: pulumi.String("string"),
SubjectName: pulumi.String("string"),
})
var databaseKafkaSchemaRegistryResource = new DatabaseKafkaSchemaRegistry("databaseKafkaSchemaRegistryResource", DatabaseKafkaSchemaRegistryArgs.builder()
.clusterId("string")
.schema("string")
.schemaType("string")
.subjectName("string")
.build());
database_kafka_schema_registry_resource = digitalocean.DatabaseKafkaSchemaRegistry("databaseKafkaSchemaRegistryResource",
cluster_id="string",
schema="string",
schema_type="string",
subject_name="string")
const databaseKafkaSchemaRegistryResource = new digitalocean.DatabaseKafkaSchemaRegistry("databaseKafkaSchemaRegistryResource", {
clusterId: "string",
schema: "string",
schemaType: "string",
subjectName: "string",
});
type: digitalocean:DatabaseKafkaSchemaRegistry
properties:
clusterId: string
schema: string
schemaType: string
subjectName: string
DatabaseKafkaSchemaRegistry 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 DatabaseKafkaSchemaRegistry resource accepts the following input properties:
- Cluster
Id string - The ID of the target Kafka cluster.
- Schema string
- The schema definition as a string.
- Schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- Subject
Name string - The name of the schema subject.
- Cluster
Id string - The ID of the target Kafka cluster.
- Schema string
- The schema definition as a string.
- Schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- Subject
Name string - The name of the schema subject.
- cluster
Id String - The ID of the target Kafka cluster.
- schema String
- The schema definition as a string.
- schema
Type String - The schema type. Available values are: avro, json, or protobuf.
- subject
Name String - The name of the schema subject.
- cluster
Id string - The ID of the target Kafka cluster.
- schema string
- The schema definition as a string.
- schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- subject
Name string - The name of the schema subject.
- cluster_
id str - The ID of the target Kafka cluster.
- schema str
- The schema definition as a string.
- schema_
type str - The schema type. Available values are: avro, json, or protobuf.
- subject_
name str - The name of the schema subject.
- cluster
Id String - The ID of the target Kafka cluster.
- schema String
- The schema definition as a string.
- schema
Type String - The schema type. Available values are: avro, json, or protobuf.
- subject
Name String - The name of the schema subject.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseKafkaSchemaRegistry 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 DatabaseKafkaSchemaRegistry Resource
Get an existing DatabaseKafkaSchemaRegistry 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?: DatabaseKafkaSchemaRegistryState, opts?: CustomResourceOptions): DatabaseKafkaSchemaRegistry
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
schema: Optional[str] = None,
schema_type: Optional[str] = None,
subject_name: Optional[str] = None) -> DatabaseKafkaSchemaRegistry
func GetDatabaseKafkaSchemaRegistry(ctx *Context, name string, id IDInput, state *DatabaseKafkaSchemaRegistryState, opts ...ResourceOption) (*DatabaseKafkaSchemaRegistry, error)
public static DatabaseKafkaSchemaRegistry Get(string name, Input<string> id, DatabaseKafkaSchemaRegistryState? state, CustomResourceOptions? opts = null)
public static DatabaseKafkaSchemaRegistry get(String name, Output<String> id, DatabaseKafkaSchemaRegistryState state, CustomResourceOptions options)
resources: _: type: digitalocean:DatabaseKafkaSchemaRegistry get: id: ${id}
- 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.
- Cluster
Id string - The ID of the target Kafka cluster.
- Schema string
- The schema definition as a string.
- Schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- Subject
Name string - The name of the schema subject.
- Cluster
Id string - The ID of the target Kafka cluster.
- Schema string
- The schema definition as a string.
- Schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- Subject
Name string - The name of the schema subject.
- cluster
Id String - The ID of the target Kafka cluster.
- schema String
- The schema definition as a string.
- schema
Type String - The schema type. Available values are: avro, json, or protobuf.
- subject
Name String - The name of the schema subject.
- cluster
Id string - The ID of the target Kafka cluster.
- schema string
- The schema definition as a string.
- schema
Type string - The schema type. Available values are: avro, json, or protobuf.
- subject
Name string - The name of the schema subject.
- cluster_
id str - The ID of the target Kafka cluster.
- schema str
- The schema definition as a string.
- schema_
type str - The schema type. Available values are: avro, json, or protobuf.
- subject_
name str - The name of the schema subject.
- cluster
Id String - The ID of the target Kafka cluster.
- schema String
- The schema definition as a string.
- schema
Type String - The schema type. Available values are: avro, json, or protobuf.
- subject
Name String - The name of the schema subject.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.