AWS AppSync to Amazon SNS

AWS AppSync → SNS

Create an AppSync GraphQl API that sends messages to an SNS topic

The CDK template creates an AppSync API with an Amazon SNS as HTTP data source. An SNS topic is created, along with an IAM role that provides the AppSync API permission to publish messages to that specific topic. Using the publish query, you can add a message to the topic.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/cdk-appsync-sns

Deploy

npm inpm run buildcdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Brice Pellé

Brice Pellé

Principal Solution Architect, AppSync - AWS.