Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

CloudFront Purger

1,008 sites Security covered Drupal 10–11
View on drupal.org

This module provides a plugin to clear the cache for AWS CloudFront, a reverse proxy for your Drupal site. It supports invalidating specific URLs or paths using cache tags, aiding in efficient cache management.

You can use AWS CloudFront as a reverse proxy in front of your whole Drupal site.

This module provides a very simple AWS CloudFront Purge Purger plugin.

WARNING: You are charged for each invalidation on CloudFront. Do your own calculations before using this module.

Features

  • Path invalidation: Invalidate specific URLs or wildcard patterns
  • Cache tag invalidation: Native CloudFront cache tag support using the Cache-Tag header and tag-based invalidation API

Required Modules

  • Path invalidation: Requies a module like Purge URLs queuer or your own custom code.
  • Cache tag invalidation: enable the CloudFront Purger Tags submodule (experimental).

    Installation

    This module requires you to have the AWS SDK loaded in your classpath.

    The recommended approach is to install this module via composer, which will also
    install the dependency. You can manually install the AWS SDK using the
    following::

    composer require aws/aws-sdk-php:~3.0

    Configuration

    You need to specify the Distribution ID in your settings.php.

    $config['cloudfront_purger.settings']['distribution_id'] = 'ABCD1234';

    Alternatively, you can use drush to set it, then export as part of your site configuration.

    drush config-set cloudfront_purger.settings distribution_id ABCD1234

    Overriding AWS CloudFront region.

    You can override the CloudFront client region by adding the following to your sites services.yml file:

    parameters:
      cloudfront.cloudfront_client.options:
        region: us-east-1
        version: latest

    AWS Authentication

    You can set the AWS key and secret in settings.php:

    $config['cloudfront_purger.settings']['aws_key'] = 'ABCD1234';
    $config['cloudfront_purger.settings']['aws_secret'] = 'ABCD1234';

    If you do not explicitly set AWS key and secret in config, it will fall back to:

    • IAM Roles
    • Exporting credentials using environment variables
    • Using a profile in a ~/.aws/credentials file

    See the AWS SDK Guide on Credentials

    You will need to allow the cloudfront:CreateInvalidation action in your IAM policy.

  • Depends on

    Dependencies of the latest stable release

    Required by

    Tracked projects that depend on this one

    No tracked projects depend on this one yet.

    Activity

    Tracked releases
    2
    Tracked since
    Mar 2025
    Latest release
    3 months ago
    Releases (12 mo)
    1
    Maintenance
    Active

    Releases

    Version Type Core Release date
    2.2.0 Stable 10–11 May 13, 2026
    2.1.1-beta1 Pre-release 10–11 Mar 25, 2025