Sending SNS messages from ubuntu: Difference between revisions

From Cramsession
Jump to navigationJump to search
✍️ Verified Author: MflavellClick to view professional profile & credentials
No edit summary
No edit summary
 
Line 1: Line 1:
[Tech Notes] > [AWS] > Sending SNS messages from ubuntu
[[Tech Notes]] > [[AWS]] > Sending SNS messages from ubuntu


= Create an SNS topic =
= Create an SNS topic =

Latest revision as of 22:53, 16 May 2026

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
}