AWS Amplify is Amazon's solution for hosting static sites and full-stack applications. It offers excellent performance with CloudFront CDN, generous free tier, and seamless AWS integration.
- An AWS account (free tier available) - Sign up at aws.amazon.com
- Your code in a Git repository (GitHub, GitLab, Bitbucket, or AWS CodeCommit)
- Credit card required for AWS account (but deployment can be free)
FREE tier includes (12 months):
- 1,000 build minutes/month
- 15GB data transfer out/month
- 5GB stored data
After free tier:
- Build minutes: $0.01/minute
- Hosting: $0.15/GB stored per month
- Data transfer: $0.15/GB served
For most landing pages: Expect $0-5/month after free tier expires.
Automatic deployments with CI/CD pipeline.
- Log in to AWS Console
- Search for "Amplify" in the services search bar
- Click "AWS Amplify"
- Click "Get Started" under "Amplify Hosting"
-
Select your Git provider:
- GitHub
- Bitbucket
- GitLab
- AWS CodeCommit
-
Click "Continue"
-
Authorize AWS Amplify to access your repositories
-
Select your repository from the dropdown
-
Select the branch to deploy (usually
mainormaster) -
Click "Next"
Amplify will try to auto-detect your build settings. Verify or update:
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*App name: Choose a name for your app (e.g., "my-landing-page")
Environment variables (if needed): Add any build-time environment variables
Click "Next"
-
Review all settings
-
Click "Save and deploy"
-
Amplify will:
- Clone your repository
- Install dependencies
- Run build command
- Deploy to CloudFront CDN
-
First deployment takes 3-5 minutes
You'll get a URL like: https://main.d1a2b3c4d5e6f7.amplifyapp.com
Every push to your connected branch automatically triggers a new deployment!
Deploy without Git repository.
npm run build- In AWS Amplify Console, scroll down to "Manual Deploy"
- Click "Get Started"
- App name: Enter a name
- Environment name:
production - Drag and drop your
distfolder - Click "Save and deploy"
Your site is live in 1-2 minutes!
Note: Manual deployments don't support automatic updates. You'll need to upload the dist folder each time.
For advanced users and automation.
npm install -g @aws-amplify/cliamplify configureFollow the prompts:
- Sign in to AWS Console
- Create an IAM user
- Enter access key and secret key
- Choose a region (e.g.,
us-east-1)
amplify initAnswer the prompts:
- App name: (enter your app name)
- Environment:
production - Default editor: (choose your editor)
- App type:
javascript - Framework:
none - Source directory:
src - Distribution directory:
dist - Build command:
npm run build - Start command:
npm start
amplify add hostingChoose:
- "Hosting with Amplify Console" (recommended)
- "Manual deployment"
amplify publishYour site is deployed!
- In your Amplify app, click "Domain management"
- Click "Add domain"
- Enter your domain name (e.g.,
yourdomain.com) - Click "Configure domain"
Amplify will show options:
yourdomain.com(root/apex domain)www.yourdomain.com(www subdomain)
Select which you want to use and click "Save"
Option A: Use Amazon Route 53 (Easiest if you use AWS)
- If your domain is in Route 53, click "Update DNS records"
- Amplify automatically updates your Route 53 hosted zone
- Click "Save"
Option B: External DNS Provider
Amplify will show DNS records to add at your domain registrar:
For apex domain (yourdomain.com):
Type: ANAME or ALIAS
Name: @
Value: (provided by Amplify)
For www subdomain:
Type: CNAME
Name: www
Value: (provided by Amplify)
For DNS providers without ANAME/ALIAS support:
Type: A
Name: @
Value: (IP addresses provided by Amplify)
- Amplify automatically requests SSL certificate from AWS Certificate Manager
- For certificate validation, add the CNAME records shown
- Wait for validation (can take 10 minutes to 48 hours)
- Once validated, your custom domain is live with HTTPS!
Deploy multiple branches to different URLs:
- Go to your Amplify app
- Click "Branch deployments"
- Click "Connect branch"
- Select branch from dropdown (e.g.,
develop,staging) - Click "Save and deploy"
Each branch gets its own URL:
main:https://main.d1a2b3c4d5e6f7.amplifyapp.comdevelop:https://develop.d1a2b3c4d5e6f7.amplifyapp.com
Perfect for testing before production!
Add build-time environment variables:
- Go to "Build settings" → "Environment variables"
- Click "Add variable"
- Enter key and value
- Choose which branches use this variable
- Click "Save"
Variables are available during build as process.env.VARIABLE_NAME
Customize your build configuration:
- Go to "Build settings"
- Click "Edit"
- Modify the
amplify.ymlfile:
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*Advanced options:
- Node version: Specify in build commands
preBuild: commands: - nvm use 22 - npm ci
Protect your site with password or restrict access:
- Go to "Access control"
- Click "Manage access"
- Select "Password protection"
- Enter username and password
- Choose which branches to protect
- Click "Save"
Great for staging environments!
- Go to "Access control"
- Enable "IP address restriction"
- Enter allowed IP addresses/ranges
- Click "Save"
Amplify automatically provides:
- CloudFront CDN: Global edge locations
- HTTP/2: Faster multiplexed connections
- Gzip/Brotli compression: Smaller file sizes
- Automatic caching: Optimized cache headers
- Asset optimization: Minification and compression
Add custom headers:
- Go to "Rewrites and redirects"
- Add custom headers:
[
{
"source": "/<*>",
"status": "200",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]Handle SPA routing and redirects:
- Go to "Rewrites and redirects"
- Add rules:
Source: </^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|woff2|ttf|map|json)$)([^.]+$)/>
Target: /index.html
Type: 200 (Rewrite)
This ensures all routes serve your index.html for SPA routing.
- Click on any deployment in the "Deployments" tab
- View detailed build logs
- Debug build failures
- Go to "Monitoring"
- View metrics:
- Requests
- Data transfer
- Errors
- CloudWatch integration for advanced monitoring
Get notified of deployment status:
- Go to "Notifications"
- Connect SNS topic or email
- Receive alerts for:
- Build success
- Build failures
- Custom events
Automatically deploy preview for every pull request:
- Go to "Build settings" → "Pull request previews"
- Enable previews
- Choose if you need password protection
- Click "Save"
Now every PR gets a unique preview URL!
If your landing page is in a monorepo:
- Go to "Build settings"
- Set "Build root directory" to your app's path
- Update
amplify.yml:
version: 1
applications:
- frontend:
phases:
preBuild:
commands:
- cd landing-page
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: landing-page/dist
files:
- '**/*'Rollback to a previous version:
- Go to "Deployments" tab
- Find the previous working deployment
- Click "Redeploy this version"
- Confirm rollback
Previous version is live in minutes!
- Optimize images: Reduce build artifact size
- Cache dependencies: Speeds up builds and saves minutes
- Limit branches: Only deploy essential branches
- Use manual deployment: For low-traffic test sites
- Go to AWS Billing Dashboard
- Check "Free Tier" usage
- Set up billing alerts
- Check build logs in deployment details
- Test build locally:
npm run build - Verify Node version matches your development environment:
preBuild: commands: - nvm use 22 - npm ci
- Check environment variables
Add rewrite rule:
- Go to "Rewrites and redirects"
- Add:
- Source:
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|woff2|ttf|map|json)$)([^.]+$)/> - Target:
/index.html - Type:
200 (Rewrite)
- Source:
- Verify DNS records at your registrar
- Wait 24-48 hours for DNS propagation
- Check certificate validation CNAME records
- Use
dig yourdomain.comto verify DNS
- Enable caching in
amplify.yml - Remove unnecessary dependencies
- Use
npm ciinstead ofnpm install
# Initialize new project
amplify init
# Add hosting
amplify add hosting
# Publish changes
amplify publish
# Check status
amplify status
# View console
amplify console
# Delete app
amplify deleteChoose AWS Amplify if you:
- Already use AWS services
- Need powerful build customization
- Want enterprise-grade CDN (CloudFront)
- Need access control and IP restrictions
- Plan to add backend features later
Choose alternatives if:
- You want simpler setup (Vercel, Netlify)
- You want unlimited free bandwidth (GitHub Pages)
- You want to avoid AWS complexity
- Set up custom domain for professional branding
- Enable PR previews for team collaboration
- Set up password protection for staging branches
- Configure monitoring and alerts
- Integrate with other AWS services (if needed)
Free tier (first 12 months):
- Build minutes: 1,000 minutes/month
- Hosting: 15GB served + 5GB stored
- Cost: $0/month (for typical landing page)
After free tier (typical landing page):
- Builds: ~100 minutes/month = $1/month
- Hosting: 5GB served = $0.75/month
- Total: ~$2-5/month
Deployment Time: 3-5 minutes per deployment Difficulty: Medium 🟡 (AWS setup required) Performance: Excellent (CloudFront CDN) ⭐⭐⭐⭐⭐