Today we’re taking a look at AWS Amplify. If you’re not familiar with it, Amplify is a development platform for building secure, scalable mobile and web applications provided by AWS.
Moving away from the commercial definition of it, you’ll also hear AWS Amplify being described as a framework that provides products to build full-stack iOS, Android, Web, and React Native apps.
“The Amplify Framework provides a set of libraries and UI components and a command-line interface to build mobile backends and integrate with your iOS, Android, Web, and React Native apps. The Amplify CLI allows you to configure all the services needed to power your backend through a simple command-line interface. The Amplify library makes it easy to integrate your code with your backend using declarative interfaces and simple UI components.” (AWS)
For me Amplify can be described as 3 important components: front-end libraries, CLI, console. The open-source libraries and UI components can be used to add cloud-powered functionality to your apps. The CLI is an open-source interactive toolchain you can use to create and manage a backend for your apps. Finally, the console is an AWS service to deploy and host full-stack serverless web apps.
AWS Amplify Libraries
AWS Amplify Console
Moving on to the console, you’ll find a Git-like workflow for deploying and hosting full-stack serverless web apps. You start by connecting your repository, where you now also have the option to use a monorepo.
Next, you can change the build settings starting from the default YAML. It is already configured for a node project to run yarn install and yarn build. If you have a different configuration, you can add custom commands in that script. You can also use your own build image. During the Build stage, AWS manages the provisioning of the build instance, clones the repository, then proceeds with the build step, and finally configures a CloudFront distribution.
If you want you can also insert a testing step before the initial deployment. Once the app is deployed, you can access it using a URL provided by Amplify. You can connect multiple branches and you’ll get multiple URLs. The final step is a verification one, complete with screenshots of the app on a few mobile devices.
One feature I’m particularly fond of is the automation of branch connections using pull requests from the repository. Here’s how it works:
- You connect to the repository - make sure you have admin privileges for your Git repo to approve the app connection
- Amplify is informed of new pull request using web hooks
- It moves on to create an environment automatically using the code from that branch
- You can preview that environment
- You can send the preview link to your client/designer/PO for feedback
- Implement the necessary changes
- Changes are deployed to master environment automatically
- The preview environment is erased
Another interesting feature which I think simplifies life is domain management. If you’ve already added your domain to Amazon Route 53 or even if you are using another service provider, you can add your domain in the Amplify console, configure it and connect branches to certain sub-domains or to the root domain. HTTPS certificates are created automatically and you can access your app on that subdomain. If the domain is hosted elsewhere there is an extra guided step for verification.
AWS Amplify CLI
The CLI is category-based with infrastructure as code best practices built-in. When you initialize a project with the CLI, you create an Amplify backend environment. The AWS Amplify CLI uses AWS CloudFormation and nested stacks, which enable you to add or modify configurations locally before you push them for deployment in your account. It allows for full transparency. To see the status of your resources at any time, run amplify status.
Amplify CLI uses CloudFormation templates to create your infrastructure. For example, running amplify add auth will bootstrap a CloudFormation template in the "amplify/backend/auth" folder.
There’s not much to tell here, short of making a live demo but it is a great tool which I’ve been using and would definitely recommend you try if you haven’t yet.
AWS Amplify pros and cons
One of the things I like best about Amplify is that it saves a lot of time. If you’re using the CLI, you’re able to build an entire infrastructure in less than a day.
Another pro is that the platform is under continuous development. They’re constantly adding new stuff and fixing bugs.
On the other hand, if you’ve never used it before, expect some of the time you save in writing code to go into learning how to use the platform. Especially in the beginning, you’ll find that sometimes it’s complicated to find the right method in the documentation, there are multiple methods for multiple versions which makes it a bit harder to navigate.
New features being constantly rolled out also means you have to stay on top of these changes and always explore the platform.
This is it for the short overview. If you have any questions or if you’d like to share your experience with Amplify, leave us a comment below.
You can also register for AWS Amplify Days, a two-day virtual event on July 15-16, where you can learn from independent developers and startups using AWS Amplify as well as AWS Amplify engineers and developers
YOU MIGHT ALSO BE INTERESTED IN
Kicking off new projects
The ABC of starting a new software project, complete with best practices, how-tos, and other resources.