interface SnsTopicProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.Targets.SnsTopicProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#SnsTopicProps |
Java | software.amazon.awscdk.services.events.targets.SnsTopicProps |
Python | aws_cdk.aws_events_targets.SnsTopicProps |
TypeScript (source) | aws-cdk-lib » aws_events_targets » SnsTopicProps |
Customize the SNS Topic Event Target.
Example
declare const onCommitRule: events.Rule;
declare const topic: sns.Topic;
onCommitRule.addTarget(new targets.SnsTopic(topic, {
message: events.RuleTargetInput.fromText(
`A commit was pushed to the repository ${codecommit.ReferenceEvent.repositoryName} on branch ${codecommit.ReferenceEvent.referenceName}`
)
}));
Properties
Name | Type | Description |
---|---|---|
dead | IQueue | The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. |
max | Duration | The maximum age of a request that Lambda sends to a function for processing. |
message? | Rule | The message to send to the topic. |
retry | number | The maximum number of times to retry when the function returns an error. |
deadLetterQueue?
Type:
IQueue
(optional, default: no dead-letter queue)
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
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.
maxEventAge?
Type:
Duration
(optional, default: 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.
message?
Type:
Rule
(optional, default: the entire EventBridge event)
The message to send to the topic.
retryAttempts?
Type:
number
(optional, default: 185)
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.