Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. Download free →
CLSkills
Cloud (AWS/GCP/Azure)intermediate

SNS Notifications

Share

Configure SNS for push notifications

Works with OpenClaude

You are an AWS cloud architect. The user wants to configure Amazon SNS (Simple Notification Service) to send push notifications to mobile devices and applications.

What to check first

  • Run aws sts get-caller-identity to verify AWS CLI is configured with correct credentials
  • Check aws sns list-topics to see existing SNS topics in your region
  • Verify your AWS account has SNS service limits not exceeded via AWS Console → Service Quotas

Steps

  1. Create an SNS topic using aws sns create-topic --name MyPushTopic and save the TopicArn from the response
  2. Create a platform application with aws sns create-platform-application --name MyMobileApp --platform GCM --attributes PlatformCredential=<server_api_key> (use APNS for iOS, GCM/FCM for Android)
  3. Register device endpoints using aws sns create-platform-endpoint --platform-application-arn <arn> --token <device_token> for each device
  4. Subscribe the platform endpoint to your SNS topic with aws sns subscribe --topic-arn <topic-arn> --protocol application --notification-endpoint <endpoint-arn>
  5. Test notification delivery with aws sns publish --topic-arn <topic-arn> --message "Test notification" --message-structure json
  6. Set up SNS delivery status logging by enabling CloudWatch logs on the platform application
  7. Configure message attributes and filtering policies in your subscription for selective message routing
  8. Implement error handling and retry logic in your application to manage failed deliveries

Code

import boto3
import json
from datetime import datetime

class SNSPushNotificationManager:
    def __init__(self, region_name='us-east-1'):
        self.sns_client = boto3.client('sns', region_name=region_name)
    
    def create_topic(self, topic_name):
        """Create SNS topic for notifications"""
        response = self.sns_client.create_topic(Name=topic_name)
        return response['TopicArn']
    
    def create_platform_app(self, app_name, platform, credentials):
        """Create platform application (iOS/Android)"""
        # platform: 'APNS' (iOS), 'GCM' (Android), 'APNS_SANDBOX'
        response = self.sns_client.create_platform_application(
            Name=app_name,
            Platform=platform,
            Attributes={
                'PlatformCredential': credentials['api_key'],
                'EventEndpointCreated': 'arn:aws:sns:region:account:topic',
                'EventEndpointDeleted': 'arn:aws:sns:region:account:topic',
                'EventEndpointUpdated': 'arn:aws:sns:region:account:topic',
                'EventDeliveryFailure': 'arn:aws:sns:region:account:topic'

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
cloudawssns

Install command:

curl -o ~/.claude/skills/sns-notifications.md https://claude-skills-hub.vercel.app/skills/cloud/sns-notifications.md

Related Cloud (AWS/GCP/Azure) Skills

Other Claude Code skills in the same category — free to download.

Want a Cloud (AWS/GCP/Azure) skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.