Amplify – Way to start your serverless journey in AWS
Before we get into the details of amplify, let us understand what challenges developers had to go through to provision the resources in aws. Earlier, when we had to use any of the aws resources, we had to spend time in integrating or creating infrastructure manually. We had to add the required libraries and UI components in our web application. Amplify made it easy to authenticate users, securely store data and user metadata, authenticate selective access to data, integrate machine learning, analyze usage metrics, and implement server-side code
What is amplify ?
AWS Amplify is a set of tools and services that can be used together or on their own, to help front-end web and mobile developers build scalable full stack applications, powered by AWS. With Amplify, you can configure app backends and connect your app in minutes, deploy static web apps in a few clicks, and easily manage app content outside the AWS console.
How do I start ?
We have many questions in our mind about any technology before we start. Once we start , we also begin to think whether we are doing it correctly or resources which we are checking is the best possible solution. In this blog, I’ll try to explain what all things we can achieve using amplify.
What are the prerequisites for web apps with amplify ?
- If you have experience with react, next js then it will come in handy
- Angular and vue can also be helpful
- Node js
- Java and many more
To begin with basic react project, kindly refer :
Overall flow of the amplify app:
There are two approaches to create the backend resources on amplify
- Using CLI , you can provision the required resources and push it to the cloud. This approach is given above for basic react project
- Amplify admin UI ( Kindly refer : https://docs.amplify.aws/console/adminui/intro )
What are the AWS resources which normally you use with amplify ?
- IAM – To provide access to AWS resources
- AWS Cognito – To authenticate the users
- Amazon API Gateway – To create API which will handle the requests from the application
- AWS Lambda – For compute and operations
- Amazon Simple Storage Service (Amazon S3) – For storage and hosting
- Amazon cloudfront – content delivery network
There is a wide range of aws resources available which you can use with amplify based on the type of application you are building. There are resources like sagemaker , amazon personalize which can be used for machine learning and artificial intelligence.The resources mentioned above are highly used for making serverless architecture and their applicability is influenced by how cost effective models need to be.
What if we want to clone the existing amplify setup ?
There are different sample projects online suitable for different case studies which we can enhance or at least understand how amplify can be used to create web apps. The amplify init command allows us to clone the existing projects with ease. To know more about cloning the existing project , go through this doc . There is another way of cloning the project and provisioning the cloud resources on your aws account. You can initialize the amplify project and except config directory rest all files to be replaced with project to be cloned. From the backend directory , edit the amplify-meta.json such that all the output urls or output data is removed and only resource names and associated code is kept. This can be understood by comparing the files from amplify directory before pushing it to the cloud and after pushing it.
What happens when you run amplify push?
All the backend resources that you have created like authentication, API gateway, lambda function are provisioned in the aws cloud such that you can access those resources in your web application.
I will be adding more technical blogs in the upcoming months. Stay tuned
Thanks for your time and please let me know if you find this article helpful.