[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEEA2A8TKZJHT27CXSCRM9":3,"skill-same:01M6EEEA2A8TKZJHT27CXSCRM9":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":41,"ownerHtmlUrl":42,"ownerBlogUrl":7,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6EEEA2A8TKZJHT27CXSCRM9","aws-sns","AWS SNS 消息通知服务",null,"","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Faws-sns\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8C1S3JDJHWXXXT0CQ0VDFGC","事件驱动与消息集成","SCENARIO","使用场景",[30,31],"aws","aws sns","2026-11-10 10:12:30",false,"# AWS SNS\n\nAmazon Simple Notification Service (SNS) is a fully managed pub\u002Fsub messaging service. Publishers send messages to topics, and subscribers receive them via SQS, Lambda, HTTP\u002FS, email, SMS, or mobile push. It's the glue for fan-out architectures.\n\n## Core Concepts\n\n- **Topic** — a logical channel for publishing messages\n- **Subscription** — an endpoint subscribed to a topic (SQS, Lambda, HTTP, email, SMS)\n- **Message filtering** — JSON policy to route only matching messages to a subscriber\n- **Fan-out** — one message published, delivered to all subscribers simultaneously\n- **FIFO Topic** — ordered, deduplicated delivery (pairs with FIFO SQS queues)\n\n## Topics\n\n```bash\n# Create a standard topic\naws sns create-topic --name order-events\n```\n\n```bash\n# Create a FIFO topic\naws sns create-topic \\\n  --name order-events.fifo \\\n  --attributes FifoTopic=true,ContentBasedDeduplication=true\n```\n\n```bash\n# List topics\naws sns list-topics --query 'Topics[].TopicArn' --output table\n```\n\n## Subscriptions\n\n```bash\n# Subscribe an SQS queue to a topic\naws sns subscribe \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events \\\n  --protocol sqs \\\n  --notification-endpoint arn:aws:sqs:us-east-1:123456789:order-processing\n```\n\n```bash\n# Subscribe a Lambda function\naws sns subscribe \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events \\\n  --protocol lambda \\\n  --notification-endpoint arn:aws:lambda:us-east-1:123456789:function:process-order\n```\n\n```bash\n# Subscribe an HTTP endpoint\naws sns subscribe \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events \\\n  --protocol https \\\n  --notification-endpoint https:\u002F\u002Fapi.myapp.com\u002Fwebhooks\u002Forders\n```\n\n```bash\n# Subscribe email (requires confirmation)\naws sns subscribe \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events \\\n  --protocol email \\\n  --notification-endpoint alerts@myapp.com\n```\n\n```bash\n# List subscriptions for a topic\naws sns list-subscriptions-by-topic \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events\n```\n\n## Publishing Messages\n\n```bash\n# Publish a message to a topic\naws sns publish \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events \\\n  --message '{\"orderId\":\"12345\",\"status\":\"completed\",\"amount\":99.99}' \\\n  --message-attributes '{\n    \"event_type\": {\"DataType\":\"String\",\"StringValue\":\"order.completed\"},\n    \"priority\": {\"DataType\":\"String\",\"StringValue\":\"high\"}\n  }'\n```\n\n```bash\n# Publish to FIFO topic\naws sns publish \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:order-events.fifo \\\n  --message '{\"orderId\":\"12345\",\"status\":\"completed\"}' \\\n  --message-group-id \"customer-789\" \\\n  --message-deduplication-id \"order-12345-completed\"\n```\n\n```bash\n# Publish with different payloads per protocol\naws sns publish \\\n  --topic-arn arn:aws:sns:us-east-1:123456789:alerts \\\n  --message-structure json \\\n  --message '{\n    \"default\": \"Order 12345 completed\",\n    \"email\": \"Your order #12345 has been completed. Thank you!\",\n    \"sqs\": \"{\\\"orderId\\\":\\\"12345\\\",\\\"status\\\":\\\"completed\\\"}\"\n  }'\n```\n\n## Message Filtering\n\n```bash\n# Set filter policy — subscriber only gets \"order.completed\" events\naws sns set-subscription-attributes \\\n  --subscription-arn arn:aws:sns:us-east-1:123456789:order-events:abc-123 \\\n  --attribute-name FilterPolicy \\\n  --attribute-value '{\n    \"event_type\": [\"order.completed\"],\n    \"priority\": [\"high\", \"critical\"]\n  }'\n```\n\n```bash\n# Filter on message body (not just attributes)\naws sns set-subscription-attributes \\\n  --subscription-arn arn:aws:sns:us-east-1:123456789:order-events:abc-123 \\\n  --attribute-name FilterPolicyScope \\\n  --attribute-value MessageBody\n\naws sns set-subscription-attributes \\\n  --subscription-arn arn:aws:sns:us-east-1:123456789:order-events:abc-123 \\\n  --attribute-name FilterPolicy \\\n  --attribute-value '{\"status\": [\"completed\"], \"amount\": [{\"numeric\": [\">=\", 100]}]}'\n```\n\n## Fan-Out Pattern (SNS → SQS)\n\n```python\n# Fan-out setup: one SNS topic publishing to multiple SQS queues\nimport boto3\nimport json\n\nsns = boto3.client('sns')\nsqs = boto3.client('sqs')\n\n# Create topic\ntopic = sns.create_topic(Name='order-events')\ntopic_arn = topic['TopicArn']\n\n# Create queues for different consumers\nqueues = ['order-fulfillment', 'order-analytics', 'order-notifications']\nfor queue_name in queues:\n    queue = sqs.create_queue(QueueName=queue_name)\n    queue_url = queue['QueueUrl']\n    attrs = sqs.get_queue_attributes(QueueUrl=queue_url, AttributeNames=['QueueArn'])\n    queue_arn = attrs['Attributes']['QueueArn']\n\n    # Allow SNS to send to SQS\n    policy = {\n        \"Statement\": [{\n            \"Effect\": \"Allow\",\n            \"Principal\": {\"Service\": \"sns.amazonaws.com\"},\n            \"Action\": \"sqs:SendMessage\",\n            \"Resource\": queue_arn,\n            \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": topic_arn}}\n        }]\n    }\n    sqs.set_queue_attributes(QueueUrl=queue_url, Attributes={\"Policy\": json.dumps(policy)})\n\n    # Subscribe\n    sns.subscribe(TopicArn=topic_arn, Protocol='sqs', Endpoint=queue_arn)\n```\n\n## Mobile Push\n\n```bash\n# Create platform application for FCM (Android)\naws sns create-platform-application \\\n  --name my-app-android \\\n  --platform GCM \\\n  --attributes PlatformCredential=\"YOUR_FCM_SERVER_KEY\"\n```\n\n```bash\n# Register a device token\naws sns create-platform-endpoint \\\n  --platform-application-arn arn:aws:sns:us-east-1:123456789:app\u002FGCM\u002Fmy-app-android \\\n  --token \"device-token-from-fcm\"\n```\n\n```bash\n# Send push notification to a device\naws sns publish \\\n  --target-arn arn:aws:sns:us-east-1:123456789:endpoint\u002FGCM\u002Fmy-app-android\u002Fabc123 \\\n  --message '{\"GCM\":\"{\\\"notification\\\":{\\\"title\\\":\\\"Order Shipped\\\",\\\"body\\\":\\\"Your order is on the way\\\"}}\"}' \\\n  --message-structure json\n```\n\n## Best Practices\n\n- Use message filtering to avoid unnecessary processing at subscribers\n- Pair SNS with SQS for reliable fan-out (SNS alone doesn't retry on failure)\n- Use FIFO topics + FIFO queues when message ordering matters\n- Set delivery retry policies for HTTP\u002FS endpoints\n- Enable CloudWatch logging on SNS topics for debugging\n- Use message attributes for routing, keep the body for data\n- Grant least-privilege access with topic policies\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Faws-sns",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":9,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill aws-sns",{"tool":51,"command":52},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill aws-sns",{"tool":54,"command":55},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill aws-sns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Faws-sns\u002FSKILL.md",true,[],[60,69,78,87,93,99],{"skillNo":61,"name":62,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":32},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[66,67,68],"model","model hierarchy","model hierarchy skill",{"skillNo":70,"name":71,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":32},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[75,76,77],"MCP","zoom","zoom mcp",{"skillNo":79,"name":80,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":32},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[84,85,86,76],"sdk","zoom apps sdk","apps",{"skillNo":88,"name":89,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":32},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[89],{"skillNo":94,"name":95,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":32},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[95],{"skillNo":100,"name":101,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":32},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[101]]