Name:
interface
Value:
Extend your Amplify Gen 2 app with AWS Blocks — self-contained backend capabilities you compose into your existing backend.
NewDeploy web apps with Git or your AI coding agent using the latest AWS Amplify. Add managed databases and authentication as you grow. Explore the documentation.
NoticeAmplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027.

Self-managed hosting

These docs cover Amplify Gen 2. For new web apps, we recommend the latest AWS Amplify, with a simplified CLI and native integrations for databases, storage, and AI models. Get started with the latest AWS Amplify.

This feature is in preview. It is not recommended for production workloads yet, and APIs may change before general availability. Share feedback or report issues on GitHub.

Self-managed hosting gives you full ownership of your frontend infrastructure. You deploy to your own AWS account using AWS CDK constructs, giving you complete control over Amazon S3 buckets, Amazon CloudFront distributions, Lambda@Edge functions, and every other resource in your stack.

How it works

You define your hosting configuration in amplify/hosting.ts using defineHosting(). This generates an AWS CDK stack with all the resources needed to serve your application. You deploy with the ampx deploy CLI command, which synthesizes and deploys both backend and frontend stacks to your AWS account.

amplify/hosting.ts
import { defineHosting } from '@aws-amplify/hosting';
export const hosting = defineHosting();

Deployment options

You have three ways to deploy self-hosted applications:

Manual deployment with ampx deploy runs directly from your local machine or any environment with AWS credentials.

Built-in pipeline with definePipeline() provisions a self-mutating AWS CodePipeline V2 that deploys on every push to your repository.

External CI/CD using GitHub Actions, GitLab CI, or any CI runner that can execute ampx deploy with the appropriate flags.

When to use self-managed hosting

Self-managed hosting is the right choice when you need direct access to your infrastructure resources, want to customize CDN behavior, require AWS WAF protection, or need to integrate hosting into an existing AWS organization with specific compliance requirements.