Publishing a message to the Amazon Simple Notification Service via AWS Console or AWS CLI to send an e-mail to the endpoint.
NOTE: The e-mail subscription require confirmation by visiting the link sent to the e-mail address.
-
Go to Amazon SNS → Topics → Your SNS Topic → Publish message
-
Enter the following information
a. Subject (optional)
b. Message body (see sample payload)
-
Click on the Publish message in the bottom right corner
-
Use the following command and replace the placeholder
sns_topic_arn
with the actual SNS Topic ARNaws sns publish \ --topic-arn sns_topic_arn \ --message file://sns-sample-message.txt \ --subject "Cash on Delivery (COD) #210327LL6J2NE7"
It will publish the specified message to the specified SNS Topic. The message comes from a text file, which enables you to include line breaks.
Hello John,
We regret to inform you that your Cash on Delivery (COD) payment request for order #210327LL6J2NE7 has been declined. We have notified the seller to cancel the shipping of your item(s).
- Publish
- Subscribe
- Amazon SNS FAQs
- Email notifications
- Amazon Simple Notification Service endpoints and quotas
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm install
install projects dependenciesnpm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation templatecdk bootstrap
deployment of AWS CloudFormation template to a specific AWS environment (account and region)cdk destroy
destroy this stack from your default AWS account/region
-
Install all the dependencies, bootstrap your project, and synthesized CloudFormation template.
# Without passing "profile" parameter dev@dev:~:aws-cdk-samples/sns/sns-email-subscription$ make init # With "profile" parameter dev@dev:~:aws-cdk-samples/sns/sns-email-subscription$ make init profile=[profile_name]
-
Deploy the project.
# Without passing "profile" parameter dev@dev:~:aws-cdk-samples/sns/sns-email-subscription$ make deploy # With "profile" parameter dev@dev:~:aws-cdk-samples/sns/sns-email-subscription$ make deploy profile=[profile_name]