This article is an English translation of "AWS Amplify Gen2への道標:Gen1からの“考え方シフト”でAWS連携型の現代的フロントエンドCI/CD基盤へ" which was originally published in Japanese.
Introduction
Hello everyone, this is Ikeda (@ikenyal)—an AWS Community Builder, AWS User Group Leader, and core member of the Amplify Japan User Group. I serve as an EM at GENDA Inc. and as Director/CTO at ZINE Inc.
Here, I’ve compiled information that may help those who’ve been using Amplify Gen1 for a long time and are now considering migrating to Gen2.
There may be plenty of people who have been using Amplify by just “clicking a few buttons to deploy” and called it good. But now that we’re moving into a new generation—“Gen2”—let’s explore Gen2-specific concepts and setup methods that differ from the past.
Amplify, which was once mainly a simple hosting and deployment tool, has evolved into a more modern CI/CD platform in Gen2. Its integration with AWS resources such as CloudFront, S3, and IAM is clearer, enhancing extensibility, speed, and security.
In this article, I’ll introduce key points you should know when moving from Gen1 to Gen2, along with links to official documentation and other reference materials. Lastly, I’ll touch on a much-anticipated new update: WAF support, which was just implemented a few days ago.
If you’ve been mastering Gen1 but haven’t yet tried Gen2, I hope this provides that “Aha, so that’s how it works!” moment.
“What’s different about Gen2?” Getting the Big Picture
Gen1:
For many users in the Gen1 era, the main approach was: “Deploy following a set pattern prepared by Amplify.” It was easy and straightforward, but as operations grew more complex, you may have felt the limitations of scalability and flexibility. Some users managed advanced setups by extending Amplify as far as possible, but that took a certain level of expertise.
Gen2:
With Gen2, Amplify has evolved into “a highly tunable service that’s part of the broader AWS infrastructure.” Integration with AWS resources like CloudFront, S3, and IAM is more transparent, making it easier to handle monorepo structures and more complex projects. The build and deployment processes have been updated, and improved caching strategies and environment variable management have greatly boosted performance, scalability, and operability.
In short, think of Amplify not just as a “simple hosting tool,” but rather as a “CI/CD platform that integrates seamlessly with AWS, enabling fast and flexible frontend operations.”
References:
- AWS Amplify Hosting - User Guide
- Introducing the Next Generation of AWS Amplify’s Fullstack Development Experience
1. Evolution in Performance and Scalability
Gen1:
You might have worried about performance lags as traffic increased, and experienced longer build times. The caching strategy was limited, so in projects with complex dependencies, inefficiencies could be quite noticeable.
Gen2:
Gen2 introduces a completely redesigned build and deployment system, supporting fast, stable operations even for monorepo structures and multi-framework projects. An intelligent caching strategy is introduced to avoid rebuilding unchanged parts, reducing build times. Plus, with CDN optimizations via CloudFront and compatibility with modern toolchains, it can handle significant simultaneous user traffic without noticeable response delays.
Key Mindset Shift:
In Gen1, you might have been “building and deploying everything,” whereas in Gen2, you’ll think “build and deploy only what’s changed for a faster release cycle.”
2. Reconsidering Configuration Files and Build Processes
Gen1:
Many operations relied on amplify.yml
for build commands and environment variables, but flexibility was limited. Managing environment variables or controlling caching could be challenging in more sophisticated scenarios.
Gen2:
The build process is more refined, and handling environment variables and cache strategies has improved. Settings from Gen1 might not transfer directly to Gen2, so it’s essential to review and align with the official docs. By doing so, environment variables can be managed more safely and clearly, and appropriate cache policies can help shorten build times and optimize deployment flows.
Key Mindset Shift:
Instead of “we’ll just fit into the environment provided,” think “let’s tune Amplify’s settings to match our own build and deployment requirements.”
3. Refined Permissions and Security
Gen1:
IAM roles and policies were often handled behind the scenes. Aligning with more complex requirements meant you might have to dive into CloudFormation directly, which could be daunting.
Gen2:
It’s now easier to understand and apply IAM and permission settings via the Amplify CLI or console. In addition, when integrating Amplify with backend services like GraphQL API, Lambda, and DynamoDB, Gen2 has further optimizations, making it easier for developers to focus on business logic and UX improvements.
Key Mindset Shift:
Move from “managing permissions within Amplify’s unique environment” to “seamlessly using AWS standard permission management through Amplify.”
4. Think of Amplify as “Part of AWS” — A Mindset Shift
Gen1:
Amplify was somewhat of a “black box.” You could use it without really understanding AWS resources, but you’d quickly run into limitations if you needed significant customizations.
Gen2:
Amplify is most effective when viewed as part of your wider AWS infrastructure. You can now fine-tune cache and security settings, set up redirects or headers for specific paths, and more at the AWS resource level (CloudFront, S3), leading to a better user experience and improved SEO.
Key Mindset Shift:
Reframe your thinking from “Amplify = a simplified gateway to AWS services” to “Amplify + AWS as a comprehensive CI/CD platform.”
5. Migration as an Opportunity: Reassess for Streamlined Operations
Moving from Gen1 to Gen2 might sound like a hassle, but think of it as the perfect chance to review your entire project. This could include:
- Improving your CI/CD pipeline
- Reconsidering your testing strategy
- Optimizing the staging and production deployment flow
By stepping away from the “it works for now” mentality, you can build a more efficient, modern development and operational environment.
You can minimize risk by taking a step-by-step approach based on official documentation. Embrace the excitement of adopting the “next generation of AWS hosting” as you go along.
WAF Support Arrived on December 18, 2024!
Finally, let’s introduce a hotly anticipated topic in the Amplify community. On December 18, 2024, Amplify Hosting gained WAF (Web Application Firewall) support. Previously, you had to manage WAF separately—like applying it through CloudFront on your own or leveraging solutions outside of Amplify. But now, you can directly apply WAF policies to Amplify Hosting itself.
This simplifies defense against common web attacks (SQL injection, XSS, etc.) using Amplify alone.
References:
Conclusion
- Gen2 transforms Amplify into a faster, more flexible AWS frontend CI/CD platform.
- Multiple improvements have been made in performance, scalability, build processes, environment variable management, and permission handling.
- Viewing Amplify as an integral part of AWS—and optimizing resources at the AWS level when needed—will be crucial going forward.
- With WAF support added on December 18, 2024, Amplify offers even more robust security out of the box.
Building on your existing Gen1 knowledge, leverage the official guides and documentation to make the leap to Gen2. It’s more than a simple version upgrade—it’s a new frontier in frontend development and operations. This is the perfect opportunity to explore Gen2—give it a try and experience the potential for next-level, modern workflows!
Top comments (0)