Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Managing ElastiCache Amazon SNS Notifications

You can configure ElastiCache to send notifications for important cluster events using Amazon Simple Notification Service (Amazon SNS). In these examples, you will configure a cluster with the Amazon Resource Name (ARN) of an Amazon SNS topic to receive notifications.

Note

This topic assumes that you've signed up for Amazon SNS and have set up and subscribed to an Amazon SNS topic. For information on how to do this, see the Amazon Simple Notification Service Developer Guide.

Adding an Amazon SNS Topic

The following sections show you how to add an Amazon SNS topic using the AWS Console, the AWS CLI, or the ElastiCache API.

Adding an Amazon SNS Topic (Console)

The following procedure shows you how to add an Amazon SNS topic for a cluster. To add an Amazon SNS topic for a replication group, in step 2, instead of choosing a cluster, choose a replication group then follow the same remaining steps.

Note

This process can also be used to modify the Amazon SNS topic.

To add or modify an Amazon SNS topic for a cluster (Console)

  1. Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/.

  2. In Clusters, choose the cluster for which you want to add or modify an Amazon SNS topic ARN.

  3. Choose Modify.

  4. In Modify Cluster under Topic for SNS Notification, choose the SNS topic you want to add, or choose Manual ARN input and type the ARN of the Amazon SNS topic.

  5. Choose Modify.

Adding an Amazon SNS Topic (AWS CLI)

To add or modify an Amazon SNS topic for a cluster, use the AWS CLI command modify-cache-cluster. To add or modify an Amazon SNS topic for a replication group, use the AWS CLI command modify-replication-group.

The following code example adds an Amazon SNS topic arn to my-cluster.

For Linux, macOS, or Unix:

Copy
aws elasticache modify-cache-cluster \ --cache-cluster-id my-cluster \ --notification-topic-arn arn:aws:sns:us-west-2:565419523791:ElastiCacheNotifications

For Windows:

Copy
aws elasticache modify-cache-cluster ^ --cache-cluster-id my-cluster ^ --notification-topic-arn arn:aws:sns:us-west-2:565419523791:ElastiCacheNotifications

For more information, see modify-cache-cluster and modify-replication-group.

Adding an Amazon SNS Topic (ElastiCache API)

To add or modify an Amazon SNS topic for a cluster, call the ModifyCacheCluster action with the following parameters:

  • CacheClusterId=my-cluster

  • TopicArn=arn%3Aaws%3Asns%3Aus-west-2%3A565419523791%3AElastiCacheNotifications

To add or modify an Amazon SNS topic for a replication group, call the ModifyReplicationGroup action.

Copy
https://elasticache.amazon.com/ ?Action=ModifyCacheCluster &ApplyImmediately=false &CacheClusterId=my-cluster &NotificationTopicArn=arn%3Aaws%3Asns%3Aus-west-2%3A565419523791%3AElastiCacheNotifications &Version=2014-12-01 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20141201T220302Z &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Date=20141201T220302Z &X-Amz-SignedHeaders=Host &X-Amz-Expires=20141201T220302Z &X-Amz-Credential=<credential> &X-Amz-Signature=<signature>

For more information, see ModifyCacheCluster and ModifyReplicationGroup.

Enabling and Disabling Amazon SNS Notifications

You can turn notifications on or off for a cluster. The following procedures show you how to disable Amazon SNS notifications.

Enabling and Disabling Amazon SNS Notifications (Console)

To disable Amazon SNS notifications using the AWS Management Console

  1. Sign in to the AWS Management Console and open the ElastiCache console at https://console.aws.amazon.com/elasticache/.

  2. Choose the engine running on the cluster you want to modify notifications for, either Memcached or Redis.

    A list of clusters running the chosen engine is displayed.

  3. In either the Memcached or Redis list, choose the box to the left of the cluster you want to modify notification for.

  4. Choose Modify.

  5. In Modify Cluster under Topic for SNS Notification, choose Disable Notifications.

  6. Choose Modify.

Enabling and Disabling Amazon SNS Notifications (AWS CLI)

To disable Amazon SNS notifications, use the command modify-cache-cluster with the following parameters:

For Linux, macOS, or Unix:

Copy
aws elasticache modify-cache-cluster \ --cache-cluster-id my-cluster \ --notification-topic-status inactive

For Windows:

Copy
aws elasticache modify-cache-cluster ^ --cache-cluster-id my-cluster ^ --notification-topic-status inactive

This command produces output similar to the following:

Copy
CACHECLUSTER my-cluster 2013-07-26T01:21:46.607Z cache.m1.large memcached available 3 us-west-2c 1.4.5 SECGROUP default active PARAMGRP default.memcached1.4 in-sync NOTIFICATION arn:aws:sns:us-west-2:565419523791:ElastiCacheNotifications inactive

Enabling and Disabling Amazon SNS Notifications (ElastiCache API)

To disable Amazon SNS notifications, call the ModifyCacheCluster action with the following parameters:

  • CacheClusterId=my-cluster

  • NotificationTopicStatus=inactive

This call returns output similar to the following:

Copy
https://elasticache.us-west-2.amazonaws.com/ ?Action=ModifyCacheCluster &ApplyImmediately=false &CacheClusterId=my-cluster &NotificationTopicStatus=inactive &Version=2014-12-01 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20141201T220302Z &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Date=20141201T220302Z &X-Amz-SignedHeaders=Host &X-Amz-Expires=20141201T220302Z &X-Amz-Credential=<credential> &X-Amz-Signature=<signature>