@aws/cloudfront-hosting-toolkit

中文文档
1.1.22发布于 2024/11/17Apache-2.0TypeScriptCommonJS近 30 天下载 2834

CloudFront Hosting Toolkit offers the convenience of a managed frontend hosting service while retaining full control over the hosting and deployment infrastructure to make it your own.

原始使用文档
文档目录14 节
  1. What is CloudFront Hosting Toolkit?
  2. How It Works
  3. Why Use CloudFront Hosting Toolkit?
  4. Getting Started
  5. Requirements
  6. Installation
  7. Quick Start
  8. Example Commands
  9. Architecture
  10. Advanced Usage
  11. Documentation
  12. Roadmap
  13. 🤝 Contributing
  14. License

CloudFront Hosting Toolkit

CloudFront Hosting Toolkit is an open-source command-line tool designed to simplify the deployment and management of fast, secure frontend applications on AWS. It offers the convenience of a managed frontend hosting service while giving developers full control over their hosting and deployment infrastructure.

GitHub Repo npm Documentation

What is CloudFront Hosting Toolkit?

CloudFront Hosting Toolkit is a comprehensive solution that automates the process of setting up and managing a robust, scalable frontend hosting infrastructure on AWS. It leverages several AWS services, including CloudFront, S3, CodePipeline, and Lambda, to create a powerful hosting environment tailored for modern web applications.

Key features include:

  • 🚀 Automated setup of AWS resources for frontend hosting
  • 🔄 Continuous deployment pipeline for GitHub and S3-based workflows
  • 🌐 Optimized content delivery through CloudFront
  • 🔒 Built-in security features including HTTPS and security headers
  • 🔗 Custom domain support with automatic SSL/TLS certificate management
  • 🛠️ Flexible configuration options for various frontend frameworks

How It Works

CloudFront Hosting Toolkit streamlines the deployment process through a simple CLI interface. It automatically provisions and configures necessary AWS resources, handles the deployment pipeline, and manages content delivery through CloudFront.

For a detailed explanation of the architecture and workflow, please refer to our Architecture documentation.

Why Use CloudFront Hosting Toolkit?

  • Simplicity: Deploy complex frontend hosting setups with just a few commands.
  • Speed: Leverage CloudFront's global CDN for fast content delivery.
  • Security: Automatic HTTPS configuration and security headers.
  • Flexibility: Support for various frontend frameworks and deployment sources.
  • Cost-Effective: Utilize AWS services efficiently without unnecessary overhead.
  • Full Control: Retain the ability to customize and extend your infrastructure.

Getting Started

Check out our documentation for comprehensive guides on setting up and using the Cloudfront Hosting Toolkit!

Requirements

  • Node.js 18+
  • AWS CLI 2+ configured with your AWS account
  • (Optional) A GitHub account for GitHub-based deployments

Installation

npm install -g @aws/cloudfront-hosting-toolkit

Quick Start

  1. Initialize your project:

    cloudfront-hosting-toolkit init
    

    The animated GIF below demonstrates the initialization process sample

  2. Deploy your website:

    cloudfront-hosting-toolkit deploy
    

    The animated GIF below demonstrates the deployment process sample

For more detailed instructions and advanced usage, please refer to our CLI Guide.

Example Commands

# Show domain name
cloudfront-hosting-toolkit show

# Check deployment status
cloudfront-hosting-toolkit status

# Remove hosting infrastructure
cloudfront-hosting-toolkit delete

Architecture

Technical diagram

CloudFront Hosting Toolkit sets up a comprehensive AWS architecture for your frontend hosting:

  • Source Control: GitHub repository or S3 bucket
  • CI/CD: AWS CodePipeline for automated builds and deployments
  • Build Process: AWS CodeBuild for compiling and creating deployment artifacts
  • Storage: S3 buckets for hosting website files
  • Content Delivery: CloudFront for global content distribution
  • Routing: CloudFront Functions for request handling and routing
  • Orchestration: Step Functions for managing deployment processes
  • State Management: KVS for storing deployment state information

This architecture ensures a scalable, performant, and maintainable hosting solution for your frontend applications.

Advanced Usage

CloudFront Hosting Toolkit offers flexibility in how it can be used:

  • CLI: Use the Command-Line Interface for a straightforward, step-by-step deployment process.
  • CDK Construct: Leverage the CloudFront Hosting Toolkit as a ready-made L3 CDK construct for seamless integration into your AWS CDK projects.
  • CDK Source Code: Customize the CDK source code to tailor the infrastructure to your specific requirements.

For more information on how to use CloudFront Hosting Toolkit, including advanced usage scenarios and in-depth customization options, please refer to our extensive documentation in the Advanced section.

Documentation

Roadmap

For information about upcoming features and improvements, please see our Roadmap.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for more details.

Author

Contributors

contributors

License

This library is licensed under the Apache-2.0 License.

版本与发布记录

@aws/cloudfront-hosting-toolkit 共发布 25 个版本,首次发布于 2023/12/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.22latest2024/11/172 年前
1.1.212024/11/062 年前
1.1.202024/11/062 年前
1.1.192024/10/242 年前
1.1.182024/10/242 年前
1.1.172024/08/192 年前

关于 @aws/cloudfront-hosting-toolkit 的常见问题

@aws/cloudfront-hosting-toolkit 是什么?

CloudFront Hosting Toolkit offers the convenience of a managed frontend hosting service while retaining full control over the hosting and deployment infrastructure to make it your own.

如何安装 @aws/cloudfront-hosting-toolkit?

在项目目录运行 npm install @aws/cloudfront-hosting-toolkit,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cloudfront-hosting-toolkit,可以用 npx cloudfront-hosting-toolkit 直接运行。

@aws/cloudfront-hosting-toolkit 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aws/cloudfront-hosting-toolkit 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aws/cloudfront-hosting-toolkit 可以商用吗?

@aws/cloudfront-hosting-toolkit 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws/cloudfront-hosting-toolkit 的下载量有多少?

根据 npm 官方下载统计,@aws/cloudfront-hosting-toolkit 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,834 次,日均约 94 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws/cloudfront-hosting-toolkit 还在维护吗?

最新版本 1.1.22 发布于 2024/11/17(2 年前);至今共发布 25 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/12/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。