interface UrlSubscriptionProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.SNS.Subscriptions.UrlSubscriptionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssnssubscriptions#UrlSubscriptionProps |
Java | software.amazon.awscdk.services.sns.subscriptions.UrlSubscriptionProps |
Python | aws_cdk.aws_sns_subscriptions.UrlSubscriptionProps |
TypeScript (source) | aws-cdk-lib » aws_sns_subscriptions » UrlSubscriptionProps |
Options for URL subscriptions.
Example
const myTopic = new sns.Topic(this, 'MyTopic');
myTopic.addSubscription(
new subscriptions.UrlSubscription(
'https://foobar.com/',
{
deliveryPolicy: {
healthyRetryPolicy: {
minDelayTarget: Duration.seconds(5),
maxDelayTarget: Duration.seconds(10),
numRetries: 6,
backoffFunction: sns.BackoffFunction.EXPONENTIAL,
},
throttlePolicy: {
maxReceivesPerSecond: 10,
},
requestPolicy: {
headerContentType: 'application/json',
},
},
},
),
);
Properties
| Name | Type | Description |
|---|---|---|
| dead | IQueue | Queue to be used as dead letter queue. |
| delivery | Delivery | The delivery policy. |
| filter | { [string]: Subscription } | The filter policy. |
| filter | { [string]: Filter } | The filter policy that is applied on the message body. |
| protocol? | Subscription | The subscription's protocol. |
| raw | boolean | The message to the queue is the same as it was sent to the topic. |
deadLetterQueue?
Type:
IQueue
(optional, default: No dead letter queue enabled.)
Queue to be used as dead letter queue.
If not passed no dead letter queue is enabled.
deliveryPolicy?
Type:
Delivery
(optional, default: if the initial delivery of the message fails, three retries with a delay between failed attempts set at 20 seconds)
The delivery policy.
filterPolicy?
Type:
{ [string]: Subscription }
(optional, default: all messages are delivered)
The filter policy.
filterPolicyWithMessageBody?
Type:
{ [string]: Filter }
(optional, default: all messages are delivered)
The filter policy that is applied on the message body.
To apply a filter policy to the message attributes, use filterPolicy. A maximum of one of filterPolicyWithMessageBody and filterPolicy may be used.
protocol?
Type:
Subscription
(optional, default: Protocol is derived from url)
The subscription's protocol.
rawMessageDelivery?
Type:
boolean
(optional, default: false)
The message to the queue is the same as it was sent to the topic.
If false, the message will be wrapped in an SNS envelope.

.NET
Go
Java
Python
TypeScript (