TargetBaseProps Struct
The generic properties for an RuleTarget.
| Source | aws-events-targets/lib/util.ts |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_events_targets as events_targets } from 'aws-cdk-lib';
import { aws_sqs as sqs } from 'aws-cdk-lib';
declare const queue: sqs.Queue;
const targetBaseProps: events_targets.TargetBaseProps = {
deadLetterQueue: queue,
maxEventAge: cdk.Duration.minutes(30),
retryAttempts: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_events_targets as events_targets
from aws_cdk import aws_sqs as sqs
# queue: sqs.Queue
target_base_props = events_targets.TargetBaseProps(
dead_letter_queue=queue,
max_event_age=cdk.Duration.minutes(30),
retry_attempts=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.events.targets.*;
import software.amazon.awscdk.services.sqs.*;
Queue queue;
TargetBaseProps targetBaseProps = TargetBaseProps.builder()
.deadLetterQueue(queue)
.maxEventAge(Duration.minutes(30))
.retryAttempts(123)
.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;
using Amazon.CDK.AWS.Events.Targets;
using Amazon.CDK.AWS.SQS;
Queue queue;
var targetBaseProps = new TargetBaseProps {
DeadLetterQueue = queue,
MaxEventAge = Duration.Minutes(30),
RetryAttempts = 123
};
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 cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var queue Queue
targetBaseProps := &TargetBaseProps{
DeadLetterQueue: queue,
MaxEventAge: cdk.Duration_Minutes(jsii.Number(30)),
RetryAttempts: jsii.Number(123),
}
Properties
deadLetterQueueoptionalIQueuedead_letter_queueoptionalIQueuedeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueue #The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
Default: no dead-letter queue
notes
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
maxEventAgeoptionalDurationmax_event_ageoptionalDurationmaxEventAgeoptionalDurationMaxEventAgeoptionalDurationMaxEventAgeoptionalDuration = Duration.hours(24) #The maximum age of a request that Lambda sends to a function for processing.
Minimum value of 60. Maximum value of 86400.
retryAttemptsoptionalnumberretry_attemptsoptionalint | floatretryAttemptsoptionalNumberRetryAttemptsoptionaldoubleRetryAttemptsoptional*float64 = 185 #The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.