I can't get this module to work.

Created on 7 June 2022, over 2 years ago
Updated 21 August 2024, 5 months ago

This is probably user error, but I just cannot seem to get this module to work, but it may be me misunderstanding how it works.

So our production site is behind CloudFront. It is a Drupal 9 site on version 9.3.15. I have installed the CloudFront Purger 2.0.0 module, the Purge module and also required aws/aws-sdk-php via composer in my project. I have enabled CloudFront Purger, Purge and Purge UI. I went into the Purge configuration in the admin and added CloudfrontPurge as a purger. I went to my AWS account and created a new user for this specific use and made sure the user had the cloudfront:CreateInvalidation permission. I then retrieved my Secret and Access key for this user along with the Distribution ID and plugged them into the CloudFront Purger config and saved it. Is this all I need to do and now when I save a page, the page will automatically get sent for invalidation? I have everything in place, but when I edit a page, nothing seems to happen. I don't get an error, but nothing at all happens. Nothing shows in the logs as it being sent for invalidation and when I login to my AWS account and go to the invalidations, I don't see any invalidations happening. Am I missing a step? I also tried adding the Purge this page block to my site, but when I click on the button in the block on a page, I get an error saying "No purger supports the type 'url', please install one!".

I did add the CloudFront config keys as environment variables and am setting them in my settings.php like this:

/**
 * Settings for CloudFront Purge.
 */
if (getenv('distribution_id')) {
  $config['cloudfront_purger.settings']['distribution_id'] = getenv('distribution_id');
}
if (getenv('aws_key')) {
  $config['cloudfront_purger.settings']['aws_key'] = getenv('aws_key');
}
if (getenv('aws_secret')) {
  $config['cloudfront_purger.settings']['aws_secret'] = getenv('aws_secret');
}

But even if I'm not doing that and I enter those values in manually in the admin, I still get nothing happening. Am I supposed to do something else for this to automatically purge the URL upon saving content?

THANKS

📌 Task
Status

Active

Version

2.0

Component

Documentation

Created by

🇺🇸United States socalerich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India rajdip_755 kolkata

    Thanks, @pcambra, for your input on comment #2!

    I faced a similar issue and found this issue thread. We're now using the purge_queuer_url module, which queues all URLs that need to be invalidated. To automatically purge the queue during cron runs, we enabled the purge_processor_cron module, which is a submodule of the purge module.

    Although the purge_queuer_url module is listed as a required module in the README file, I believe it would be beneficial to mention this requirement on the project page as well.

Production build 0.71.5 2024