c. Publish to SNS topic

In this section, you’ll publish a test message to the SNS topic you created to confirm you can receive the notifications.

  1. In the AWS Cloud9 terminal, login to the head node of your cluster (if not logged in already)
pcluster ssh perflab-yourname -i ~/.ssh/lab-4-key

Publish a test message to the SNS topic

  1. First check the subscription using list-subscriptions-by-topic command as follows:
aws sns list-subscriptions-by-topic --topic-arn $MY_SNS_TOPIC --region $REGION
  1. Amazon SNS returns an output as following: SNS TOPIC

  2. Publish a test message to the topic using the publish command

aws sns publish --message "Verification" --topic $MY_SNS_TOPIC --region $REGION
  1. Amazon SNS returns an output as following: SNS TOPIC

  2. Check your email to confirm that you received the message. You should have received an email as below:

SNS TOPIC

Next, we will publish a job completion notification as part of your Slurm Job.