AWS Amplify
Full-stack web and mobile development on AWS: Amplify Hosting with Git-based continuous deployment, branch and pull request environments, SSR support, custom domains, and WAF, plus code-first backends for auth, data, storage, and functions, with security, cost, and comparisons.
4 min read · Last reviewed · SAA-C03
Sign in to bookmark tutorials and track what you have read.
On this page
What it is
AWS Amplify is a set of tools and services that lets front-end web and mobile developers build and host full-stack applications on AWS without assembling every service by hand. It has two main parts:
- Amplify Hosting: a Git-based workflow for building, deploying, and hosting web apps with continuous deployment. Amplify deploys the app to the AWS global CDN (Content delivery network)A network of servers in many locations that caches content close to users, so that pages, images, and video load faster and the origin server handles less traffic. Amazon CloudFront is the AWS CDN.Glossary entry (CDN).
- Amplify backends: you describe the back end (authentication, data, storage, functions) in TypeScript code, and Amplify provisions the AWS resources for you, building on the AWS CDK.
Amplify also includes client libraries and UI components for web frameworks and mobile platforms.
Choose Amplify when a question describes a front-end team that wants to build and deploy a web or mobile app quickly, with sign-in, an API (Application programming interface)A defined way for one program to ask another for data or actions, such as a set of HTTPS requests and responses. Every AWS service is controlled through its API, which the console, the CLI, and the SDKs call for you.Glossary entry, and storage, and little AWS infrastructure work.
Amplify Hosting
- Frameworks: server-side rendered (SSR) frameworks such as Next.js and Nuxt (others with an adapter); single-page apps such as React, Angular, and Vue.js; and static site generators such as Gatsby and Hugo.
- Continuous deployment: connect a Git repository, and every commit to a branch builds and deploys automatically.
- Feature branches: each connected branch gets its own environment, such as
mainfor production anddevfor staging. - Pull request previews: a temporary preview of each pull request for code review.
- Custom domains, with a managed certificate that Amplify provisions or your own; redirects and rewrites. A single-page app with a client-side router needs a rewrite (200) rule that serves
index.htmlfor app routes, so deep links and page refreshes load the app instead of returning 404; a redirect (301 or 302) changes the URL in the browser instead. - Password-protected branches keep unreleased work private.
- Firewall support: attach AWS WAF rules to the hosted site.
Amplify backends
You define resources in files such as amplify/auth/resource.ts and amplify/data/resource.ts:
- Auth: Amplify deploys an Amazon Cognito user pool for sign-up, sign-in, MFA (Multi-factor authentication)Signing in with two or more different kinds of proof, such as a password plus a code from a phone app or a security key. AWS recommends MFA for the root user and for every human user.Glossary entry, and social sign-in.
- Data: typed real-time APIs powered by AWS AppSync (GraphQL), with data in Amazon DynamoDB.
- Storage: files in Amazon S3.
- Functions: business logic in AWS Lambda.
Each developer can use a cloud sandbox for testing, and shared environments map to Git branches.
Security, resilience, performance, and cost
Security
- Amplify sets up Cognito for users and authorization rules for data, such as owner-based access, so each user sees only their own records.
- IAM controls who can manage Amplify apps; CloudTrail records Amplify API calls.
- Use password protection for preview branches and AWS WAF for production sites.
Resilience
- Hosted sites are served from the global CDN, and the back end uses managed, Regional services (Cognito, AppSync, DynamoDB, S3, Lambda) with no servers to look after.
Performance
- The CDN caches static content close to users; SSR pages are rendered on demand.
Cost
- Amplify Hosting charges for build minutes, data stored on the CDN, data transferred out, and, for SSR apps, request count and duration. There is a free tier for 12 months.
- Back-end resources (Cognito, AppSync, DynamoDB, S3, Lambda) are billed by those services.
Monitoring
- Hosting metrics and logs appear in CloudWatch, and build logs appear in the Amplify console.
Amplify or another option?
| If the requirement is | Choose |
|---|---|
| Front-end team wants Git-based hosting and a full-stack backend fast | AWS Amplify |
| Host a static website with the most control | Amazon S3 with Amazon CloudFront |
| A managed GraphQL API only | AWS AppSync |
| A REST (Representational state transfer)A style of web API in which resources are named by URLs and handled with standard HTTP methods, such as GET, PUT, and DELETE, and the server keeps no session state between requests. Amazon API Gateway builds REST APIs.Glossary entry API in front of Lambda | Amazon API Gateway |
| User sign-up and sign-in only | Amazon Cognito |
| Test the app on real phones and tablets | AWS Device Farm |
Reverse mindmap: when the question points here
- Yes, when the question says
- Front-end developers build a full-stack app quickly leads to Amplify
- Host a React, Angular, Vue, or Next.js app with CI/CD leads to Amplify Hosting
- Deploy on every Git commit leads to Amplify Hosting
- Preview environment for each pull request leads to PR previews
- SPA deep links return 404 leads to Rewrite (200) rule to index.html
- Know what it builds on
- Sign-up and sign-in leads to Amazon Cognito
- Real-time GraphQL data leads to AWS AppSync with DynamoDB
- File uploads leads to Amazon S3
- Backend logic leads to AWS Lambda
- No, when the question says
- Full control of a static site and its CDN leads to S3 with CloudFront
- Test on real devices leads to Device Farm
Key takeaways
- Amplify helps front-end web and mobile developers build and host full-stack apps on AWS.
- Amplify Hosting gives Git-based continuous deployment to a global CDN, feature-branch environments, PR previews, custom domains, and WAF.
- Amplify backends are defined in TypeScript and provision Cognito (auth), AppSync and DynamoDB (data), S3 (storage), and Lambda (functions).
- Hosting is billed for build minutes, storage, data transfer, and SSR requests.
Sources
- AWS Amplify Hosting User Guide: Welcome to AWS Amplify Hosting
- AWS Amplify Hosting User Guide: Deploying server-side rendered applications
- AWS Amplify Hosting User Guide: Feature branch deployments and team workflows
- AWS Amplify Hosting User Guide: Web previews for pull requests
- AWS Amplify Hosting User Guide: Setting up redirects and rewrites for an Amplify application
- AWS Amplify Hosting User Guide: Connecting a custom domain
- AWS Amplify Hosting User Guide: Restricting access to an Amplify app's branches
- AWS Amplify Hosting User Guide: Firewall support for Amplify hosted sites
- AWS Amplify Hosting User Guide: Monitoring an Amplify application with Amazon CloudWatch
- AWS Amplify Hosting User Guide: Logging Amplify API calls using AWS CloudTrail
- AWS Amplify Documentation: How Amplify works, concepts
- AWS Amplify pricing