SNS Publisher
This graph template allows the graph to publish an object to Amazon's Simple Notification Service (SNS).
Amazon Simple Notification Service (SNS) is a flexible, fully managed pub/sub messaging and mobile notifications service for coordinating the delivery of messages to subscribing endpoints and clients. With SNS you can fan-out messages to a large number of subscribers, including distributed systems and services, and mobile devices. It is easy to set up, operate, and reliably send notifications to all your endpoints – at any scale. For more information about SNS and its capabilities, click here.
Package Contents
- Graphs:
- publishMessageToSNS (parameterized graph)
- Refresh App Params Graph Template
- Nodes
- Javascripts
- awsSignaturev4
- createSNSOptions
- encryptOrDecrypt (optional: Use this to encrypt your tokens to save in appParams)
- Web Services
- send to SNS, REST API
- Javascripts
- Connections
- SNS service endpoint
Schema Location
Setup
- Deploy the 'Publish Message to AWS SNS' template to create all the required Kitewheel resources
- On the 'Create a New Item' screen, select the 'AWS SNS Publish' Graph
- Configure the SNS REST Web Service connection with the relevant endpoint, select yours from AWS SNS Supported Countries:
- Follow the instructions for the setup of the Application Parameters Graph Template
- AWS Credentials
- It is optional but recommended that you encrypt your awsAccessKey and your awsSecretAccessKey when storing in the appParams database table
- Use the included encryptDecrypt javascript node to encrypt your credentials before you save to the appParams table
- Insert the the AWS SNS parameters into the appParams table using the following SQL:
INSERT INTO appParams(paramKey,paramValue,paramType,description) VALUES ('awsAccessKeyId', 'awsAccessKeyIdKEY GOES HERE', 'string', 'This is the access key for AWS SNS'), ('awsSecretAccessKey', 'awsSecretAccessKey GOES HERE', 'string', 'This is the secret key for AWS SNS'), ('awsSNSRegion', 'awsSNSRegion GOES HERE', 'string', 'This is the SNS Region for AWS SNS'), ('awsSNSTopicARN', 'awsSNSTopicARN GOES HERE', 'string', 'This is the SNS Topic ARN for AWS SNS'), ('awsSNSHost', 'awsSNSHost GOES HERE', 'string', 'This is the SNS Host for AWS SNS');
- If using encryption, include the additional appParam
INSERT INTO appParams(paramKey,paramValue,paramType,description) VALUES ('awsKeysEncrypted', 'true', 'string', 'Encryption flag for AWS SNS');
Using
- Place the publishMessageToSNS graph in your graph
- The expected outputs for this graph are true, 'metaSet'. The parent graph should also accomodate GoTo and Error
- Set the graph parameter 'objectToPublish', this should be the entire object that needs to the published to the SNS region
- The result of the api call will be added to the {schema}.SNS.apiResponse array
- Test your graph
Notes:
Tip: If appParams is initialised and the 'refreshAppParams' subgraph is used earlier than 'publishMessageToSNS' in your main graph then feel free to update the start node to avoid duplication
What is likely to go wrong
- AWS Access Tokens are not encrypted and you have set awsKeysEncrypted='true'
- Resolution: pick a method. We recommend encrypting your tokens amd using awsKeysEncrypted='true'
- You are using SNS in a different AWS Region
- Check AWS SNS Supported Countries and ensure you have set your SNS Connection endpoint to the correct region
Typical Deliverables Plan
Use this plan to agree the requirements from the Kitewheel User and your client/ brand
Privacy Policy
© 2022 CSG International, Inc.