RedriveAllowPolicy Struct
Permission settings for the dead letter source queue.
Example
ts
declare const sourceQueue: sqs.IQueue;
// Only the sourceQueue can specify this queue as the dead-letter queue.
const queue1 = new sqs.Queue(this, 'Queue2', {
redriveAllowPolicy: {
sourceQueues: [sourceQueue],
}
});
// No source queues can specify this queue as the dead-letter queue.
const queue2 = new sqs.Queue(this, 'Queue', {
redriveAllowPolicy: {
redrivePermission: sqs.RedrivePermission.DENY_ALL,
}
});
python
# source_queue: sqs.IQueue
# Only the sourceQueue can specify this queue as the dead-letter queue.
queue1 = sqs.Queue(self, "Queue2",
redrive_allow_policy=sqs.RedriveAllowPolicy(
source_queues=[source_queue]
)
)
# No source queues can specify this queue as the dead-letter queue.
queue2 = sqs.Queue(self, "Queue",
redrive_allow_policy=sqs.RedriveAllowPolicy(
redrive_permission=sqs.RedrivePermission.DENY_ALL
)
)
java
IQueue sourceQueue;
// Only the sourceQueue can specify this queue as the dead-letter queue.
Queue queue1 = Queue.Builder.create(this, "Queue2")
.redriveAllowPolicy(RedriveAllowPolicy.builder()
.sourceQueues(List.of(sourceQueue))
.build())
.build();
// No source queues can specify this queue as the dead-letter queue.
Queue queue2 = Queue.Builder.create(this, "Queue")
.redriveAllowPolicy(RedriveAllowPolicy.builder()
.redrivePermission(RedrivePermission.DENY_ALL)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
IQueue sourceQueue;
// Only the sourceQueue can specify this queue as the dead-letter queue.
var queue1 = new Queue(this, "Queue2", new QueueProps {
RedriveAllowPolicy = new RedriveAllowPolicy {
SourceQueues = new [] { sourceQueue }
}
});
// No source queues can specify this queue as the dead-letter queue.
var queue2 = new Queue(this, "Queue", new QueueProps {
RedriveAllowPolicy = new RedriveAllowPolicy {
RedrivePermission = RedrivePermission.DENY_ALL
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var sourceQueue IQueue
// Only the sourceQueue can specify this queue as the dead-letter queue.
queue1 := sqs.NewQueue(this, jsii.String("Queue2"), &QueueProps{
RedriveAllowPolicy: &RedriveAllowPolicy{
SourceQueues: []IQueue{
sourceQueue,
},
},
})
// No source queues can specify this queue as the dead-letter queue.
queue2 := sqs.NewQueue(this, jsii.String("Queue"), &QueueProps{
RedriveAllowPolicy: &RedriveAllowPolicy{
RedrivePermission: sqs.RedrivePermission_DENY_ALL,
},
})
Properties
redrivePermissionoptionalRedrivePermissionredrive_permissionoptionalRedrivePermissionredrivePermissionoptionalRedrivePermissionRedrivePermissionoptionalRedrivePermissionRedrivePermissionoptionalRedrivePermission#Permission settings for source queues that can designate this queue as their dead-letter queue.
Default: RedrivePermission.BY_QUEUE if sourceQueues is specified,RedrivePermission.ALLOW_ALL otherwise.
sourceQueuesoptionalIQueue[]source_queuesoptionaltyping.List[IQueue]sourceQueuesoptionalList<IQueue>SourceQueuesoptionalIQueue[]SourceQueuesoptional*[]IQueue#Source queues that can designate this queue as their dead-letter queue.
Default: Required when redrivePermission is RedrivePermission.BY_QUEUE, cannot be defined otherwise.
notes
When redrivePermission is set to RedrivePermission.BY_QUEUE, this parameter is required.
You can specify up to 10 source queues. To allow more than 10 source queues to specify dead-letter queues, set the redrivePermission to RedrivePermission.ALLOW_ALL.
When redrivePermission is either RedrivePermission.ALLOW_ALL or RedrivePermission.DENY_ALL, this parameter cannot be set.