`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.
npm install ember-cli-deploy-cloudfrontVerified import paths — ran on the pinned version, not inferred.
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.
Ensure your deployment environment uses a compatible Node.js version (16+ for v6.x). Upgrade Node.js if necessary.
If you have implemented a custom `invalidationClient`, you must update your code to use the AWS SDK v3 API for `CloudFrontClient` and related commands. Refer to the AWS SDK for JavaScript v3 documentation for migration guides.
Carefully review the AWS SDK credential resolution documentation to understand the precedence. For production environments, consider using IAM roles for EC2 instances or OIDC for GitHub Actions instead of hardcoding keys or relying solely on local profiles.
Ensure `accessKeyId` and `secretAccessKey` are set in `config/deploy.js`, or that a valid `profile` with an associated `region` is configured in `~/.aws/credentials`, or that environment variables like `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are present and accessible.
Verify that `objectPaths` in `config/deploy.js` is correctly configured with valid paths (e.g., `['/index.html', '/assets/*']`). Remember that all object paths must be relative to the CloudFront distribution root and begin with `/`.
Double-check the `distribution` ID in your `config/deploy.js` against your AWS CloudFront console to ensure it is accurate and belongs to the correct AWS account/region.
Grant the required `cloudfront:CreateInvalidation` permission to the IAM user or role whose credentials are being used by the `ember-cli-deploy-cloudfront` plugin in your AWS IAM console.