Experimental
@aws-cdk/aws-iot-actions-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
HttpActionBatchConfig Struct
Configuration for batching HTTP action messages.
| Stability | Experimental |
|---|---|
| Source | lib/https-action.ts |
Example
ts
import { Size } from 'aws-cdk-lib';
declare const topicRule: iot.TopicRule;
topicRule.addAction(
new actions.HttpsAction('https://example.com/endpoint', {
batchConfig: {
maxBatchOpenDuration: Duration.millis(100),
maxBatchSize: 5,
maxBatchSizeBytes: Size.kibibytes(1),
},
}),
);
python
from aws_cdk import Size
# topic_rule: iot.TopicRule
topic_rule.add_action(
actions.HttpsAction("https://example.com/endpoint",
batch_config=actions.HttpActionBatchConfig(
max_batch_open_duration=Duration.millis(100),
max_batch_size=5,
max_batch_size_bytes=Size.kibibytes(1)
)
))
java
import software.amazon.awscdk.Size;
TopicRule topicRule;
topicRule.addAction(
HttpsAction.Builder.create("https://example.com/endpoint")
.batchConfig(HttpActionBatchConfig.builder()
.maxBatchOpenDuration(Duration.millis(100))
.maxBatchSize(5)
.maxBatchSizeBytes(Size.kibibytes(1))
.build())
.build());
csharp
// Install: dotnet add package Amazon.CDK.AWS.IoT.Actions.Alpha
using Amazon.CDK;
TopicRule topicRule;
topicRule.AddAction(
new HttpsAction("https://example.com/endpoint", new HttpsActionProps {
BatchConfig = new HttpActionBatchConfig {
MaxBatchOpenDuration = Duration.Millis(100),
MaxBatchSize = 5,
MaxBatchSizeBytes = Size.Kibibytes(1)
}
}));
go
// Install: go get github.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2
import "github.com/aws/aws-cdk-go/awscdk"
var topicRule TopicRule
topicRule.AddAction(
actions.NewHttpsAction(jsii.String("https://example.com/endpoint"), &HttpsActionProps{
BatchConfig: &HttpActionBatchConfig{
MaxBatchOpenDuration: awscdk.Duration_Millis(jsii.Number(100)),
MaxBatchSize: jsii.Number(5),
MaxBatchSizeBytes: awscdk.Size_Kibibytes(jsii.Number(1)),
},
}))
Properties
maxBatchOpenDurationoptionalDurationmax_batch_open_durationoptionalDurationmaxBatchOpenDurationoptionalDurationMaxBatchOpenDurationoptionalDurationMaxBatchOpenDurationoptionalDuration = Duration.millis(20) #The maximum amount of time an outgoing message waits for other messages to create the batch.
Must be between 5 ms and 200 ms.
maxBatchSizeoptionalnumbermax_batch_sizeoptionalint | floatmaxBatchSizeoptionalNumberMaxBatchSizeoptionaldoubleMaxBatchSizeoptional*float64 = 10 #The maximum number of messages that are batched together in a single IoT rule action execution.
Must be between 2 and 10.