SNS & CloudWatch Notifications to Pushover (Android / iPhone)
We use Amazon Web Services extensively here and rely on CloudWatch notifications to keep us abrest of how our infrastructure is performing. CloudWatch has great integration with SNS topics and alerts are a doddle to configure. However, by default SNS topics cannot be pushed to your smartphone without creating your own fully fledged app. When you work in a small team, this is not really an option. SNS can push to URLs, however, and Pushover has a simple API.
The following script allows simple notifications from SNS topics to be pushed to your smartphone via Pushover.
- Download Pushover app and sign-up.
- Create an application on Pushover and copy the API key
- Insert your new API key and your user key in the script.
- Copy script to any PHP enabled webserver.
- In your SNS topic, add a new subscription.
- "Protocol" will be HTTP or HTTPS depending on your server setup
- "Endpoint" is the full path to the script. You can optionally add "u" parameter to send to non-default user or group; e.g. http://example.com/sns/push.php?u=1234567980
- Subscription will be automatically confirmed and available to push right away.