AWS Amplify CLI Hosting Plugin

3.4.10 · active · verified Wed Apr 22

This package is a core plugin for the AWS Amplify Command Line Interface (CLI), specifically designed to manage the hosting services for Amplify projects. It empowers developers to seamlessly add, update, push, and remove web hosting capabilities, primarily leveraging services like AWS Amplify Console (for full-stack deployments) or Amazon S3/CloudFront (for static site hosting). While the overall Amplify CLI is in its `v14.x` major version, this specific plugin (`amplify-category-hosting`) is at version `3.4.10`, indicating a stable and less frequently updated internal component. The Amplify CLI generally follows a frequent release cadence, often weekly or bi-weekly, for bug fixes and minor improvements across its various categories. Its key differentiator is deeply integrating hosting with other Amplify backend categories (Auth, API, Storage) and providing a streamlined CI/CD pipeline for frontend web applications, simplifying the deployment process for developers.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates initializing an Amplify project, adding Amplify Console hosting for manual deployment, building the frontend, and publishing it to the cloud. It also shows how to remove the hosting category.

npx amplify-cli init --amplify-config '{"projectName":"myamplifyapp","envName":"dev","defaultEditor":"code","frontend":"javascript","framework":"react","srcDir":"src","distDir":"build","buildCommand":"npm run-script build","startCommand":"npm run-script start"}' --force
cd myamplifyapp
# Add hosting for a Single Page App (SPA) or PWA
amplify hosting add
# Choose 'Hosting with Amplify Console (Managed hosting and CI/CD)'
# Choose 'Manual deployment'
# Or integrate with a Git repository for continuous deployment.

# After adding hosting and building your frontend, deploy it:
npm run build
amplify publish

# To remove hosting later:
amplify hosting remove

view raw JSON →