s3-deploy is a Node.js-based command-line utility designed for deploying files to Amazon S3 buckets and managing associated CloudFront cache invalidations. Currently at version 1.4.0, it appears to be actively maintained, indicated by the Greenkeeper badge, though a specific release cadence isn't published. Key differentiators include its robust handling of cache-control headers (including `max-age`, `immutable`, `no-cache`, and custom `Cache-Control`), automatic gzip compression for specified file types, and an option to prevent updates based on ETag matching. It's particularly useful for static site deployments where fine-grained caching and CDN invalidation are critical, providing a simplified bash-like interface over direct AWS SDK usage for common deployment tasks.
npm install s3-deployNo compatibility data collected yet for this library.
Deploys local build artifacts to S3, sets caching headers, gzips common file types, and invalidates CloudFront cache.
Use only one cache-related parameter, or explicitly use `--cacheControl` for full customizability to avoid unintended behavior.
Combine `--preventUpdates` with a robust CI/CD strategy or S3 bucket policies if absolute immutability is required.
Understand the behavior of `--etag` with and without a value. If you need a specific value, provide it; otherwise, rely on automatic MD5 hashing.
Ensure the correct CloudFront Distribution ID is provided with the `--distId` flag for successful cache invalidation.
Verify that your glob pattern correctly matches files relative to the `--cwd` path. Test with a dry run or small set of files first.
Remove conflicting cache control parameters. Prioritize `--cacheControl` if custom and complex caching rules are needed, or ensure only one of `--noCache`, `--cache`, or `--immutable` is used.
Review your AWS IAM policy. Ensure the user or role has `s3:PutObject`, `s3:GetObject`, `s3:ListBucket` (for `--preventUpdates`), and `cloudfront:CreateInvalidation` permissions for the target resources.
Double-check the glob pattern and the `--cwd` value. Ensure they correctly point to the files you intend to deploy relative to your execution directory.
Verify the CloudFront Distribution ID is correct. Ensure your AWS IAM user/role has `cloudfront:CreateInvalidation` permissions for the specified distribution.
No dependency data recorded yet.