interface SnsTopicProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Events.Targets.SnsTopicProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#SnsTopicProps |
![]() | software.amazon.awscdk.services.events.targets.SnsTopicProps |
![]() | aws_cdk.aws_events_targets.SnsTopicProps |
![]() | 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.fromObject(
{
DataType: `custom_${events.EventField.fromPath('$.detail-type')}`
}
)
}));
Properties
Name | Type | Description |
---|---|---|
authorize | boolean | Specifies whether an IAM role should be used to publish to the topic. |
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. |
role? | IRole | The IAM role to be used to publish to the topic. |
authorizeUsingRole?
Type:
boolean
(optional, default: true if role
is provided, false otherwise)
Specifies whether an IAM role should be used to publish to the topic.
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.
role?
Type:
IRole
(optional, default: a new role will be created if authorizeUsingRole
is true)
The IAM role to be used to publish to the topic.