CloudFront client

This page contains some example usage for CloudFront. There are other resources that explain authentication and configuration.

The CloudFront package could be installed with Composer.

composer require async-aws/cloud-front

Usage

Invalidate paths

use AsyncAws\CloudFront\CloudFrontClient; use AsyncAws\CloudFront\ValueObject\InvalidationBatch; use AsyncAws\CloudFront\ValueObject\Paths; $cloudFront = new CloudFrontClient(); $paths = ['/assets/images/cat.jpg', '/image/*']; $cloudFront->createInvalidation([ 'DistributionId' => 'EQ44GEF5FAALL', 'InvalidationBatch' => new InvalidationBatch([ 'Paths' => new Paths([ 'Quantity' => count($paths), 'Items' => $paths, ]), 'CallerReference' => time(), ]), ]);