# HealthyRetryPolicy

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

- Source: [`aws-sns/lib/delivery-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-sns/lib/delivery-policy.ts#L52)
- Type last changed: v2.169.0 · 21 Nov 2024

## 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',
        },
      },
    },
  ),
);
```

## Properties

- `backoffFunction`: [BackoffFunction](/cdk/api/v2/docs/aws-cdk-lib.aws_sns.BackoffFunction.html) = linear — The model for backoff between retries.

- `maxDelayTarget`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — 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,

- `minDelayTarget`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — 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.

- `numMaxDelayRetries`: number = 0 — The number of retries in the post-backoff phase, with the maximum delay between them.

  Must be zero or greater

- `numMinDelayRetries`: number = 0 — The number of retries in the pre-backoff phase, with the specified minimum delay between them.

  Must be zero or greater

- `numNoDelayRetries`: number = 0 — The number of retries to be done immediately, with no delay between them.

  Must be zero or greater.

- `numRetries`: number = 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.
