Sending SNS messages from ubuntu

From Cramsession
Revision as of 22:53, 16 May 2026 by Mflavell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
✍️ Verified Author: MflavellClick to view professional profile & credentials

Tech Notes > AWS > Sending SNS messages from ubuntu

Create an SNS topic

  • Longin to the AWS console
  • Open SNS (Simple Notification Service)
  • Create a standard topic
  • Enter a name
  • Click "create topic"
  • Copy down the ARN for the topic
  • Subscribe your email to the topic for testing.


Install the tools

Installing AWS CLI

try the test script

here's a simple test script:

SNS_ARN="arn:aws:sns:your_ARN_goes_here"
SUBJECT="$1"
MESSAGE="$2"

sns_publish(){
  response=$(
    aws sns publish \
      --topic-arn "$SNS_ARN" \
      --subject "$1" \
      --message "$2"
  )
  echo $response
}