Skip to content
v2.278.0

HealthyRetryPolicy Struct ​

Options for customising the retry policy of the delivery of SNS messages to HTTP/S endpoints.

Example ​

ts
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',
        },
      },
    },
  ),
);
python
my_topic = sns.Topic(self, "MyTopic")

my_topic.add_subscription(
    subscriptions.UrlSubscription("https://foobar.com/",
        delivery_policy=sns.DeliveryPolicy(
            healthy_retry_policy=sns.HealthyRetryPolicy(
                min_delay_target=Duration.seconds(5),
                max_delay_target=Duration.seconds(10),
                num_retries=6,
                backoff_function=sns.BackoffFunction.EXPONENTIAL
            ),
            throttle_policy=sns.ThrottlePolicy(
                max_receives_per_second=10
            ),
            request_policy=sns.RequestPolicy(
                header_content_type="application/json"
            )
        )
    ))
java
Topic myTopic = new Topic(this, "MyTopic");

myTopic.addSubscription(
UrlSubscription.Builder.create("https://foobar.com/")
        .deliveryPolicy(DeliveryPolicy.builder()
                .healthyRetryPolicy(HealthyRetryPolicy.builder()
                        .minDelayTarget(Duration.seconds(5))
                        .maxDelayTarget(Duration.seconds(10))
                        .numRetries(6)
                        .backoffFunction(BackoffFunction.EXPONENTIAL)
                        .build())
                .throttlePolicy(ThrottlePolicy.builder()
                        .maxReceivesPerSecond(10)
                        .build())
                .requestPolicy(RequestPolicy.builder()
                        .headerContentType("application/json")
                        .build())
                .build())
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var myTopic = new Topic(this, "MyTopic");

myTopic.AddSubscription(
new UrlSubscription("https://foobar.com/", new UrlSubscriptionProps {
    DeliveryPolicy = new DeliveryPolicy {
        HealthyRetryPolicy = new HealthyRetryPolicy {
            MinDelayTarget = Duration.Seconds(5),
            MaxDelayTarget = Duration.Seconds(10),
            NumRetries = 6,
            BackoffFunction = BackoffFunction.EXPONENTIAL
        },
        ThrottlePolicy = new ThrottlePolicy {
            MaxReceivesPerSecond = 10
        },
        RequestPolicy = new RequestPolicy {
            HeaderContentType = "application/json"
        }
    }
}));
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
myTopic := sns.NewTopic(this, jsii.String("MyTopic"))

myTopic.AddSubscription(
subscriptions.NewUrlSubscription(jsii.String("https://foobar.com/"), &UrlSubscriptionProps{
	DeliveryPolicy: &DeliveryPolicy{
		HealthyRetryPolicy: &HealthyRetryPolicy{
			MinDelayTarget: awscdk.Duration_Seconds(jsii.Number(5)),
			MaxDelayTarget: awscdk.Duration_*Seconds(jsii.Number(10)),
			NumRetries: jsii.Number(6),
			BackoffFunction: sns.BackoffFunction_EXPONENTIAL,
		},
		ThrottlePolicy: &ThrottlePolicy{
			MaxReceivesPerSecond: jsii.Number(10),
		},
		RequestPolicy: &RequestPolicy{
			HeaderContentType: jsii.String("application/json"),
		},
	},
}))

Properties ​

backoffFunctionoptionalBackoffFunctionbackoff_functionoptionalBackoffFunctionbackoffFunctionoptionalBackoffFunctionBackoffFunctionoptionalBackoffFunctionBackoffFunctionoptionalBackoffFunction = linear #
The model for backoff between retries.
maxDelayTargetoptionalDurationmax_delay_targetoptionalDurationmaxDelayTargetoptionalDurationMaxDelayTargetoptionalDurationMaxDelayTargetoptionalDuration #
The maximum delay for a retry.

Default: 20 seconds

Must be at least minDelayTarget less than 3,600 seconds, and correspond to a whole number of seconds,

minDelayTargetoptionalDurationmin_delay_targetoptionalDurationminDelayTargetoptionalDurationMinDelayTargetoptionalDurationMinDelayTargetoptionalDuration #
The minimum delay for a retry.

Default: 20 seconds

Must be at least one second, not exceed maxDelayTarget, and correspond to a whole number of seconds.

numMaxDelayRetriesoptionalnumbernum_max_delay_retriesoptionalint | floatnumMaxDelayRetriesoptionalNumberNumMaxDelayRetriesoptionaldoubleNumMaxDelayRetriesoptional*float64 = 0 #
The number of retries in the post-backoff phase, with the maximum delay between them.

Must be zero or greater

numMinDelayRetriesoptionalnumbernum_min_delay_retriesoptionalint | floatnumMinDelayRetriesoptionalNumberNumMinDelayRetriesoptionaldoubleNumMinDelayRetriesoptional*float64 = 0 #
The number of retries in the pre-backoff phase, with the specified minimum delay between them.

Must be zero or greater

numNoDelayRetriesoptionalnumbernum_no_delay_retriesoptionalint | floatnumNoDelayRetriesoptionalNumberNumNoDelayRetriesoptionaldoubleNumNoDelayRetriesoptional*float64 = 0 #
The number of retries to be done immediately, with no delay between them.

Must be zero or greater.

numRetriesoptionalnumbernum_retriesoptionalint | floatnumRetriesoptionalNumberNumRetriesoptionaldoubleNumRetriesoptional*float64 = 3 #
The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries.

Must be greater than or equal to zero and not exceed 100.