Skip to content
v2.277.0

KafkaSchemaRegistryConfig Struct ​

(Amazon MSK and self-managed Apache Kafka only) Specific configuration settings for a Kafka schema registry.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const eventRecordFormat: lambda.EventRecordFormat;
declare const kafkaSchemaRegistryAccessConfigType: lambda.KafkaSchemaRegistryAccessConfigType;
declare const kafkaSchemaValidationAttribute: lambda.KafkaSchemaValidationAttribute;
const kafkaSchemaRegistryConfig: lambda.KafkaSchemaRegistryConfig = {
  eventRecordFormat: eventRecordFormat,
  schemaRegistryUri: 'schemaRegistryUri',
  schemaValidationConfigs: [{
    attribute: kafkaSchemaValidationAttribute,
  }],

  // the properties below are optional
  accessConfigs: [{
    type: kafkaSchemaRegistryAccessConfigType,
    uri: 'uri',
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

# event_record_format: lambda.EventRecordFormat
# kafka_schema_registry_access_config_type: lambda.KafkaSchemaRegistryAccessConfigType
# kafka_schema_validation_attribute: lambda.KafkaSchemaValidationAttribute

kafka_schema_registry_config = lambda.KafkaSchemaRegistryConfig(
    event_record_format=event_record_format,
    schema_registry_uri="schemaRegistryUri",
    schema_validation_configs=[lambda.KafkaSchemaValidationConfig(
        attribute=kafka_schema_validation_attribute
    )],

    # the properties below are optional
    access_configs=[lambda.KafkaSchemaRegistryAccessConfig(
        type=kafka_schema_registry_access_config_type,
        uri="uri"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;

EventRecordFormat eventRecordFormat;
KafkaSchemaRegistryAccessConfigType kafkaSchemaRegistryAccessConfigType;
KafkaSchemaValidationAttribute kafkaSchemaValidationAttribute;

KafkaSchemaRegistryConfig kafkaSchemaRegistryConfig = KafkaSchemaRegistryConfig.builder()
        .eventRecordFormat(eventRecordFormat)
        .schemaRegistryUri("schemaRegistryUri")
        .schemaValidationConfigs(List.of(KafkaSchemaValidationConfig.builder()
                .attribute(kafkaSchemaValidationAttribute)
                .build()))

        // the properties below are optional
        .accessConfigs(List.of(KafkaSchemaRegistryAccessConfig.builder()
                .type(kafkaSchemaRegistryAccessConfigType)
                .uri("uri")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;

EventRecordFormat eventRecordFormat;
KafkaSchemaRegistryAccessConfigType kafkaSchemaRegistryAccessConfigType;
KafkaSchemaValidationAttribute kafkaSchemaValidationAttribute;

var kafkaSchemaRegistryConfig = new KafkaSchemaRegistryConfig {
    EventRecordFormat = eventRecordFormat,
    SchemaRegistryUri = "schemaRegistryUri",
    SchemaValidationConfigs = new [] { new KafkaSchemaValidationConfig {
        Attribute = kafkaSchemaValidationAttribute
    } },

    // the properties below are optional
    AccessConfigs = new [] { new KafkaSchemaRegistryAccessConfig {
        Type = kafkaSchemaRegistryAccessConfigType,
        Uri = "uri"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var eventRecordFormat EventRecordFormat
var kafkaSchemaRegistryAccessConfigType KafkaSchemaRegistryAccessConfigType
var kafkaSchemaValidationAttribute KafkaSchemaValidationAttribute

kafkaSchemaRegistryConfig := &KafkaSchemaRegistryConfig{
	EventRecordFormat: eventRecordFormat,
	SchemaRegistryUri: jsii.String("schemaRegistryUri"),
	SchemaValidationConfigs: []KafkaSchemaValidationConfig{
		&KafkaSchemaValidationConfig{
			Attribute: kafkaSchemaValidationAttribute,
		},
	},

	// the properties below are optional
	AccessConfigs: []KafkaSchemaRegistryAccessConfig{
		&KafkaSchemaRegistryAccessConfig{
			Type: kafkaSchemaRegistryAccessConfigType,
			Uri: jsii.String("uri"),
		},
	},
}

Properties ​

accessConfigsoptionalKafkaSchemaRegistryAccessConfig[]access_configsoptionaltyping.List[KafkaSchemaRegistryAccessConfig]accessConfigsoptionalList<KafkaSchemaRegistryAccessConfig>AccessConfigsoptionalKafkaSchemaRegistryAccessConfig[]AccessConfigsoptional*[]KafkaSchemaRegistryAccessConfig= none#
An array of access configuration objects that tell Lambda how to authenticate with your schema registry.
eventRecordFormatEventRecordFormatevent_record_formatEventRecordFormateventRecordFormatEventRecordFormatEventRecordFormatEventRecordFormatEventRecordFormatEventRecordFormat= nonerequired#
The record format that Lambda delivers to your function after schema validation.
notes
  • Choose JSON to have Lambda deliver the record to your function as a standard JSON object.
  • Choose SOURCE to have Lambda deliver the record to your function in its original source format. Lambda removes all schema metadata, such as the schema ID, before sending the record to your function.
schemaRegistryUristringschema_registry_uristrschemaRegistryUriStringSchemaRegistryUristringSchemaRegistryUri*string= nonerequired#
The URI for your schema registry.

The correct URI format depends on the type of schema registry you're using.

schemaValidationConfigsKafkaSchemaValidationConfig[]schema_validation_configstyping.List[KafkaSchemaValidationConfig]schemaValidationConfigsList<KafkaSchemaValidationConfig>SchemaValidationConfigsKafkaSchemaValidationConfig[]SchemaValidationConfigs*[]KafkaSchemaValidationConfig= nonerequired#
An array of schema validation configuration objects, which tell Lambda the message attributes you want to validate and filter using your schema registry.