KafkaSchema
# Kafka Schema Resource
The Kafka Schema resource allows the creation and management of Aiven Kafka Schemas.
Example Usage
using Pulumi;
using Aiven = Pulumi.Aiven;
class MyStack : Stack
{
public MyStack()
{
var kafka_schema1 = new Aiven.KafkaSchema("kafka-schema1", new Aiven.KafkaSchemaArgs
{
Project = aiven_project.Kafka_schemas_project1.Project,
ServiceName = aiven_service.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 (
"fmt"
"github.com/pulumi/pulumi-aiven/sdk/v3/go/aiven"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aiven.NewKafkaSchema(ctx, "kafka_schema1", &aiven.KafkaSchemaArgs{
Project: pulumi.Any(aiven_project.Kafka - schemas - project1.Project),
ServiceName: pulumi.Any(aiven_service.Kafka - service1.Service_name),
SubjectName: pulumi.String("kafka-schema1"),
CompatibilityLevel: pulumi.String("FORWARD"),
Schema: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", " {\n", " \"doc\": \"example\",\n", " \"fields\": [{\n", " \"default\": 5,\n", " \"doc\": \"my test number\",\n", " \"name\": \"test\",\n", " \"namespace\": \"test\",\n", " \"type\": \"int\"\n", " }],\n", " \"name\": \"example\",\n", " \"namespace\": \"example\",\n", " \"type\": \"record\"\n", " }\n")),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aiven as aiven
kafka_schema1 = aiven.KafkaSchema("kafka-schema1",
project=aiven_project["kafka-schemas-project1"]["project"],
service_name=aiven_service["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_service["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"
}
`,
});
Create a KafkaSchema Resource
new KafkaSchema(name: string, args: KafkaSchemaArgs, opts?: CustomResourceOptions);
def KafkaSchema(resource_name: str, opts: Optional[ResourceOptions] = None, compatibility_level: Optional[str] = None, project: Optional[str] = None, schema: Optional[str] = None, service_name: Optional[str] = None, subject_name: Optional[str] = None)
func NewKafkaSchema(ctx *Context, name string, args KafkaSchemaArgs, opts ...ResourceOption) (*KafkaSchema, error)
public KafkaSchema(string name, KafkaSchemaArgs args, CustomResourceOptions? opts = null)
- 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.
- opts ResourceOptions
- A bag of options that control this 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.
KafkaSchema Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The KafkaSchema resource accepts the following input properties:
- Project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- Schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- Service
Name string Service to link the Kafka Schema to
- Subject
Name string is Kafka Schema subject name.
- Compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.
- Project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- Schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- Service
Name string Service to link the Kafka Schema to
- Subject
Name string is Kafka Schema subject name.
- Compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.
- project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- service
Name string Service to link the Kafka Schema to
- subject
Name string is Kafka Schema subject name.
- compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.
- project str
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- schema str
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- service_
name str Service to link the Kafka Schema to
- subject_
name str is Kafka Schema subject name.
- compatibility_
level str configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.
Outputs
All input properties are implicitly available as output properties. Additionally, the KafkaSchema resource produces the following output properties:
Look up an 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, 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)
- 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.
The following state arguments are supported:
- Compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.- Project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- Schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- Service
Name string Service to link the Kafka Schema to
- Subject
Name string is Kafka Schema subject name.
- Version int
Kafka Schema configuration version
- Compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.- Project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- Schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- Service
Name string Service to link the Kafka Schema to
- Subject
Name string is Kafka Schema subject name.
- Version int
Kafka Schema configuration version
- compatibility
Level string configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.- project string
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- schema string
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- service
Name string Service to link the Kafka Schema to
- subject
Name string is Kafka Schema subject name.
- version number
Kafka Schema configuration version
- compatibility_
level str configuration compatibility level overrides specific subject resource. If the compatibility level not specified for the individual subject by default, it takes a global value. Allowed values:
BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
.- project str
and
service_name
- (Required) define the project and service the Kafka Schemas belongs to. They should be defined using reference as shown above to set up dependencies correctly.- schema str
is Kafka Schema configuration should be a valid Avro Schema JSON format.
- service_
name str Service to link the Kafka Schema to
- subject_
name str is Kafka Schema subject name.
- version int
Kafka Schema configuration version
Package Details
- Repository
- https://github.com/pulumi/pulumi-aiven
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aiven
Terraform Provider.