This module allows a Drupal site to respond to Amazon SNS notifications. For example, perhaps some upstream system is processing a long job and the Drupal site needs to update entity data when it's done. Instead of being forced to poll with queues and use a background Drush command, SNS can instead push a notification to Drupal. Each SNS message triggers a
Symfony Event that other modules or custom code can respond to. SNS itself handles redelivery and failure logging.
As this module requires the AWS SDK, sites using this module will need to use Composer to grab it and all other dependencies.
This module implements it's own API as an example for other modules. To learn how to create your own event subscribers, see amazon_sns.services.yml and \Drupal\amazon_sns\Event\SnsSubscriptionConfirmationSubscriber.
Setting up a subscription
This module expects all SNS notifications to be sent to /_amazon-sns/notify. To test basic functionality, you can create an SNS topic and send a test message using the Amazon Web Services console.
- Log in to AWS and open the SNS dashboard.
- Under
Common Actions, create a topic. - In the topic, click
Create subscription.- Select HTTP or HTTPS as the protocol.
- Enter
https://example.com/_amazon-sns/notifyas the endpoint. The URL
must be accessible to Amazon for SNS to work. Consider setting up a proxy
like ngrok or requestb.in for local environments or additional logging. - After saving, there should be a subscription confirmation logged in Drupal's logs.
- Use
Publish to Topicto send a test message. The message will be logged. You're ready to write any custom code needed to react to the notification.
Project information
- Project categories: Developer tools
198 sites report using this module
- Created by deviantintegral on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Drupal 11 compatibility
Development version: 8.x-1.x-dev updated 24 Oct 2024 at 14:09 UTC





