Configuring SNS Delivery Retry Policies

amazon-sns, amazon-web-services, aws-cloudformation

Solution

AWS CloudFormation sometimes doesn't cover all (new) API actions available within other AWS Products & Services, though they usually get introduced within a few month later on.

Unfortunately, despite SNS Delivery Retry Policies for HTTP/HTTPS Endpoints being introduced in December 2011 already, this feature is still not supported as of today.

Workaround

You might be able to implement a workaround with CloudFormation still by means of the dedicated CustomResource type, which are special AWS CloudFormation resources that provide a way for a template developer to include resources in an AWS CloudFormation stack that are provided by a source other than Amazon Web Services. - the AWS CloudFormation Custom Resource Walkthrough provides a good overview of what this is all about, how it works and what's required to implement your own.

Your custom resource would need to implement the missing support for delivery retry policies by explicitly calling the SetSubscriptionAttributes or SetTopicAttributes API actions with the apparently also undocumented `DeliveryPolicy` attribute as per the Sample Requests shown there, e.g.:

{
    "healthyRetryPolicy": 
    {
        "minDelayTarget":  <int>,
        "maxDelayTarget": <int>,
        "numRetries": <int>,
        "numMaxDelayRetries": <int>,
        "backoffFunction": "<linear|arithmetic|geometric|exponential>"
    },
    "throttlePolicy":
    {
        "maxReceivesPerSecond": <int>
    }
}

Problem

I would like to know if is possible to configure SNS Delivery Retry Policies through cloudFormation. I couldn't find it in any online documentation. If such configuration is possible, I would really appreciate if someone could post a snippet showing how to do it. Thanks in Advance,

Original source