Experimental
@aws-cdk/aws-iot-actions-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
SqsQueueActionProps Struct
Configuration properties of an action for SQS.
| Stability | Experimental |
|---|---|
| Source | lib/sqs-queue-action.ts |
Example
ts
import * as sqs from 'aws-cdk-lib/aws-sqs';
const queue = new sqs.Queue(this, 'MyQueue');
const topicRule = new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323(
"SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'",
),
actions: [
new actions.SqsQueueAction(queue, {
useBase64: true, // optional property, default is 'false'
}),
],
});
python
import aws_cdk.aws_sqs as sqs
queue = sqs.Queue(self, "MyQueue")
topic_rule = iot.TopicRule(self, "TopicRule",
sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
actions=[
actions.SqsQueueAction(queue,
use_base64=True
)
]
)
java
import software.amazon.awscdk.services.sqs.*;
Queue queue = new Queue(this, "MyQueue");
TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
.sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"))
.actions(List.of(
SqsQueueAction.Builder.create(queue)
.useBase64(true)
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.IoT.Actions.Alpha
using Amazon.CDK.AWS.SQS;
var queue = new Queue(this, "MyQueue");
var topicRule = new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
Actions = new [] {
new SqsQueueAction(queue, new SqsQueueActionProps {
UseBase64 = true
}) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2
import sqs "github.com/aws/aws-cdk-go/awscdk"
queue := sqs.NewQueue(this, jsii.String("MyQueue"))
topicRule := iot.NewTopicRule(this, jsii.String("TopicRule"), &TopicRuleProps{
Sql: iot.IotSql_FromStringAsVer20160323(jsii.String("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'")),
Actions: []IAction{
actions.NewSqsQueueAction(queue, &SqsQueueActionProps{
UseBase64: jsii.Boolean(true),
}),
},
})
Properties
The IAM role that allows access to AWS service.
Default: a new role will be created
useBase64optionalbooleanuse_base64optionalbooluseBase64optionalBooleanUseBase64optionalboolUseBase64optional*bool = false #Specifies whether to use Base64 encoding.