aiven.KafkaSchema
Explore with Pulumi AI
The Kafka Schema resource allows the creation and management of Aiven Kafka Schemas.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aiven = Pulumi.Aiven;
return await Deployment.RunAsync(() =>
{
var kafka_schema1 = new Aiven.KafkaSchema("kafka-schema1", new()
{
Project = aiven_project.Kafka_schemas_project1.Project,
ServiceName = aiven_kafka.Kafka_service1.Service_name,
SubjectName = "kafka-schema1",
CompatibilityLevel = "FORWARD",
Schema = @" {
""doc"": ""example"",
""fields"": [{
""default"": 5,
""doc"": ""my test number"",
""name"": ""test"",
""namespace"": ""test"",
""type"": ""int""
}],
""name"": ""example"",
""namespace"": ""example"",
""type"": ""record""
}
",
});
});
package main
import (
"github.com/pulumi/pulumi-aiven/sdk/v6/go/aiven"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aiven.NewKafkaSchema(ctx, "kafka-schema1", &aiven.KafkaSchemaArgs{
Project: pulumi.Any(aiven_project.KafkaSchemasProject1.Project),
ServiceName: pulumi.Any(aiven_kafka.KafkaService1.Service_name),
SubjectName: pulumi.String("kafka-schema1"),
CompatibilityLevel: pulumi.String("FORWARD"),
Schema: pulumi.String(` {
"doc": "example",
"fields": [{
"default": 5,
"doc": "my test number",
"name": "test",
"namespace": "test",
"type": "int"
}],
"name": "example",
"namespace": "example",
"type": "record"
}
`),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.KafkaSchema;
import com.pulumi.aiven.KafkaSchemaArgs;
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_schema1 = new KafkaSchema("kafka-schema1", KafkaSchemaArgs.builder()
.project(aiven_project.kafka-schemas-project1().project())
.serviceName(aiven_kafka.kafka-service1().service_name())
.subjectName("kafka-schema1")
.compatibilityLevel("FORWARD")
.schema("""
{
"doc": "example",
"fields": [{
"default": 5,
"doc": "my test number",
"name": "test",
"namespace": "test",
"type": "int"
}],
"name": "example",
"namespace": "example",
"type": "record"
}
""")
.build());
}
}
import pulumi
import pulumi_aiven as aiven
kafka_schema1 = aiven.KafkaSchema("kafka-schema1",
project=aiven_project["kafka-schemas-project1"]["project"],
service_name=aiven_kafka["kafka-service1"]["service_name"],
subject_name="kafka-schema1",
compatibility_level="FORWARD",
schema=""" {
"doc": "example",
"fields": [{
"default": 5,
"doc": "my test number",
"name": "test",
"namespace": "test",
"type": "int"
}],
"name": "example",
"namespace": "example",
"type": "record"
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";
const kafka_schema1 = new aiven.KafkaSchema("kafka-schema1", {
project: aiven_project["kafka-schemas-project1"].project,
serviceName: aiven_kafka["kafka-service1"].service_name,
subjectName: "kafka-schema1",
compatibilityLevel: "FORWARD",
schema: ` {
"doc": "example",
"fields": [{
"default": 5,
"doc": "my test number",
"name": "test",
"namespace": "test",
"type": "int"
}],
"name": "example",
"namespace": "example",
"type": "record"
}
`,
});
resources:
kafka-schema1:
type: aiven:KafkaSchema
properties:
project: ${aiven_project"kafka-schemas-project1"[%!s(MISSING)].project}
serviceName: ${aiven_kafka"kafka-service1"[%!s(MISSING)].service_name}
subjectName: kafka-schema1
compatibilityLevel: FORWARD
schema: |2
{
"doc": "example",
"fields": [{
"default": 5,
"doc": "my test number",
"name": "test",
"namespace": "test",
"type": "int"
}],
"name": "example",
"namespace": "example",
"type": "record"
}
Create KafkaSchema Resource
new KafkaSchema(name: string, args: KafkaSchemaArgs, opts?: CustomResourceOptions);
@overload
def KafkaSchema(resource_name: str,
opts: Optional[ResourceOptions] = None,
compatibility_level: Optional[str] = None,
project: Optional[str] = None,
schema: Optional[str] = None,
schema_type: Optional[str] = None,
service_name: Optional[str] = None,
subject_name: Optional[str] = None)
@overload
def KafkaSchema(resource_name: str,
args: KafkaSchemaArgs,
opts: Optional[ResourceOptions] = None)
func NewKafkaSchema(ctx *Context, name string, args KafkaSchemaArgs, opts ...ResourceOption) (*KafkaSchema, error)
public KafkaSchema(string name, KafkaSchemaArgs args, CustomResourceOptions? opts = null)
public KafkaSchema(String name, KafkaSchemaArgs args)
public KafkaSchema(String name, KafkaSchemaArgs args, CustomResourceOptions options)
type: aiven:KafkaSchema
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KafkaSchemaArgs
- 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 KafkaSchemaArgs
- 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 KafkaSchemaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KafkaSchemaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KafkaSchemaArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
KafkaSchema Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The KafkaSchema resource accepts the following input properties:
- Project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- Service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- Compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- Schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- Project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- Service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- Compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- Schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- project String
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema String
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- service
Name String Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name String The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- compatibility
Level String Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- schema
Type String Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- project str
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema str
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- service_
name str Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject_
name str The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- compatibility_
level str Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- schema_
type str Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- project String
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema String
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- service
Name String Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name String The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- compatibility
Level String Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- schema
Type String Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
Outputs
All input properties are implicitly available as output properties. Additionally, the KafkaSchema resource produces the following output properties:
Look up Existing KafkaSchema Resource
Get an existing KafkaSchema 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?: KafkaSchemaState, opts?: CustomResourceOptions): KafkaSchema
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compatibility_level: Optional[str] = None,
project: Optional[str] = None,
schema: Optional[str] = None,
schema_type: Optional[str] = None,
service_name: Optional[str] = None,
subject_name: Optional[str] = None,
version: Optional[int] = None) -> KafkaSchema
func GetKafkaSchema(ctx *Context, name string, id IDInput, state *KafkaSchemaState, opts ...ResourceOption) (*KafkaSchema, error)
public static KafkaSchema Get(string name, Input<string> id, KafkaSchemaState? state, CustomResourceOptions? opts = null)
public static KafkaSchema get(String name, Output<String> id, KafkaSchemaState 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.
- Compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- Project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- Schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- Service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- Version int
Kafka Schema configuration version.
- Compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- Project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- Schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- Service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- Subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- Version int
Kafka Schema configuration version.
- compatibility
Level String Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- project String
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema String
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- schema
Type String Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- service
Name String Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name String The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- version Integer
Kafka Schema configuration version.
- compatibility
Level string Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- project string
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema string
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- schema
Type string Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- service
Name string Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name string The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- version number
Kafka Schema configuration version.
- compatibility_
level str Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- project str
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema str
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- schema_
type str Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- service_
name str Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject_
name str The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- version int
Kafka Schema configuration version.
- compatibility
Level String Kafka Schemas compatibility level. The possible values are
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
andNONE
.- project String
Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- schema String
Kafka Schema configuration. Should be a valid Avro, JSON, or Protobuf schema, depending on the schema type.
- schema
Type String Kafka Schema configuration type. Defaults to AVRO. Possible values are AVRO, JSON, and PROTOBUF.
- service
Name String Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.
- subject
Name String The Kafka Schema Subject name. This property cannot be changed, doing so forces recreation of the resource.
- version Number
Kafka Schema configuration version.
Import
$ pulumi import aiven:index/kafkaSchema:KafkaSchema kafka-schema1 project/service_name/subject_name
Package Details
- Repository
- Aiven pulumi/pulumi-aiven
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aiven
Terraform Provider.