KafkaActionProperty Struct
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const kafkaActionProperty: iot.CfnTopicRule.KafkaActionProperty = {
clientProperties: {
clientPropertiesKey: 'clientProperties',
},
destinationArn: 'destinationArn',
topic: 'topic',
// the properties below are optional
headers: [{
key: 'key',
value: 'value',
}],
key: 'key',
partition: 'partition',
};
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_iot as iot
kafka_action_property = iot.CfnTopicRule.KafkaActionProperty(
client_properties={
"client_properties_key": "clientProperties"
},
destination_arn="destinationArn",
topic="topic",
# the properties below are optional
headers=[iot.CfnTopicRule.KafkaActionHeaderProperty(
key="key",
value="value"
)],
key="key",
partition="partition"
)
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.iot.*;
KafkaActionProperty kafkaActionProperty = KafkaActionProperty.builder()
.clientProperties(Map.of(
"clientPropertiesKey", "clientProperties"))
.destinationArn("destinationArn")
.topic("topic")
// the properties below are optional
.headers(List.of(KafkaActionHeaderProperty.builder()
.key("key")
.value("value")
.build()))
.key("key")
.partition("partition")
.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.IoT;
var kafkaActionProperty = new KafkaActionProperty {
ClientProperties = new Dictionary<string, string> {
{ "clientPropertiesKey", "clientProperties" }
},
DestinationArn = "destinationArn",
Topic = "topic",
// the properties below are optional
Headers = new [] { new KafkaActionHeaderProperty {
Key = "key",
Value = "value"
} },
Key = "key",
Partition = "partition"
};
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"
kafkaActionProperty := &KafkaActionProperty{
ClientProperties: map[string]*string{
"clientPropertiesKey": jsii.String("clientProperties"),
},
DestinationArn: jsii.String("destinationArn"),
Topic: jsii.String("topic"),
// the properties below are optional
Headers: []interface{}{
&KafkaActionHeaderProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
Key: jsii.String("key"),
Partition: jsii.String("partition"),
}
Properties
clientPropertiesIResolvable | { [key: string]: string }client_propertiestyping.Union[IResolvable, typing.Mapping[str, str]]clientPropertiesIResolvableClientPropertiesIResolvableClientPropertiesinterface{} required #Properties of the Apache Kafka producer client.
destinationArnstringdestination_arnstrdestinationArnStringDestinationArnstringDestinationArn*string required #The ARN of Kafka action's VPC `TopicRuleDestination` .
headersoptionalIResolvable | IResolvable | CfnTopicRule.headersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, KafkaActionHeaderProperty]]]headersoptionalIResolvableHeadersoptionalIResolvableHeadersoptionalinterface{} #The list of Kafka headers that you specify.
The Kafka message key.
partitionoptionalstringpartitionoptionalstrpartitionoptionalStringPartitionoptionalstringPartitionoptional*string #The Kafka message partition.
The Kafka topic for messages to be sent to the Kafka broker.