Registry / aws / ember-cli-deploy-cloudfront

ember-cli-deploy-cloudfront

JSON →
library6.0.0jsnpmunverified

`ember-cli-deploy-cloudfront` is an `ember-cli-deploy` plugin designed to automate the invalidation of cached files on AWS CloudFront distributions as part of an Ember application's continuous deployment pipeline. The current stable version is 6.0.0, which notably updates the underlying AWS SDK to v3. The package's release cadence is tied to Node.js LTS support and critical dependency upgrades, such as the AWS SDK. Its primary use case is invalidating `index.html` after a new deployment, though it supports invalidating multiple custom paths and multiple CloudFront distributions. It differentiates itself by providing seamless integration into the `ember-cli-deploy` ecosystem, allowing developers to manage CloudFront cache busts directly from their Ember CLI projects without manual AWS console intervention. It supports various AWS authentication methods, including access keys, IAM roles, and profiles.

awsdevops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

While `ember-cli-deploy-cloudfront` itself is a plugin configured via `config/deploy.js` and not typically imported directly, developers might need to import `CloudFrontClient` when implementing a custom `invalidationClient` option, especially with the AWS SDK v3 update in `6.0.0`.

import { CloudFrontClient } from '@aws-sdk/client-cloudfront';

Similar to `CloudFrontClient`, this command is relevant if a custom `invalidationClient` is being developed to programmatically create invalidations using AWS SDK v3 for `ember-cli-deploy-cloudfront@6.x`.

import { CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';

This TypeScript type is useful for developers who are creating custom `invalidationClient` implementations and need to type their configuration objects for the AWS SDK v3 client.

import { CloudFrontClientConfig } from '@aws-sdk/client-cloudfront';

This quickstart demonstrates how to install `ember-cli-deploy-cloudfront` and configure it in `config/deploy.js` to invalidate `index.html` and other assets on a specified CloudFront distribution after deployment, using environment variables for sensitive AWS credentials.

/* config/deploy.js */ module.exports = function(deployTarget) { const ENV = { build: { environment: deployTarget }, 'cdn-url': { // Example for a paired s3-index plugin, typically used with cloudfront url: process.env.CDN_URL || 'https://your-cloudfront-distribution-domain.com' }, cloudfront: { // Recommended: use environment variables for sensitive credentials accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '', distribution: process.env.CLOUDFRONT_DISTRIBUTION_ID ?? '', // REQUIRED: Your CloudFront Distribution ID region: process.env.AWS_REGION ?? 'us-east-1', // Specify your AWS region objectPaths: ['/index.html', '/assets/*'], // Paths to invalidate. Must start with '/' waitForInvalidation: true // Wait for the invalidation to complete (introduced in v2.0.0) } }; // Add additional deploy target specific configuration here if (deployTarget === 'production') { // Specific production settings } return ENV; }; // To install: // ember install ember-cli-deploy-cloudfront // To run deployment with activation: // AWS_ACCESS_KEY_ID='YOUR_KEY' AWS_SECRET_ACCESS_KEY='YOUR_SECRET' CLOUDFRONT_DISTRIBUTION_ID='E123ABCDEFGH' ember deploy production --activate
ember --version
Debug
Known footguns
breakingMinimum Node.js version has been progressively increased across major versions. `ember-cli-deploy-cloudfront@6.x` requires Node.js `16.* || 18.* || >= 20`. Earlier versions of the plugin dropped support for Node 6 (v2), Node 8 (v3), Node 10 (v4), and Node 12 (v5).
breaking`ember-cli-deploy-cloudfront@6.0.0` upgraded the underlying AWS SDK from v2 to v3. This introduces breaking changes in the SDK's API, which will affect any custom `invalidationClient` implementations or direct interactions with the SDK.
gotchaAWS credentials (e.g., `accessKeyId`, `secretAccessKey`, `profile`) are resolved by the AWS SDK in a specific order. Explicitly setting `accessKeyId` and `secretAccessKey` directly in `config/deploy.js` will override environment variables or profile settings, which might lead to unexpected behavior.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
Resources