DEV Community

Annysah for AWS Community Builders

Posted on • Updated on

Getting started with AWS Amplify

Introduction

AWS Amplify is a powerful development platform for building secure, scalable mobile and web applications. It makes it easy for developers to authenticate users, store data, and deploy static websites. In this article, we'll go over the key features of AWS Amplify and the basics of getting started.

Key features of AWS Amplify

Some key features of AWS Amplify includes:

Authentication

Using providers like Amazon Cognito or Okta, AWS Amplify enables developers to quickly integrate authentication to their applications. Developers can also alter the authentication process by providing passwordless login or multi-factor authentication.

Storage

Amplify offers a range of options for data storage, including NoSQL storage through Amazon DynamoDB and object storage through Amazon S3. These services can be used by developers to store user data, media files, and other application-specific data.

Serverless functions

Using Amplify with AWS Lambda, developers can create and deploy serverless functions. These functions can be used to perform tasks like sending emails, image resizing, and data validation.

GraphQL API

AWS Amplify provides a GraphQL API that allows developers to create and consume data in their applications. The API integrates with data sources such as Amazon DynamoDB and Amazon Aurora, and supports real-time subscriptions and offline data access.

Static web hosting

With Amplify, developers can easily deploy static websites to the cloud. Developers can use Amplify's Git-based workflow to deploy their websites, which are then hosted on Amazon S3 and served via Amazon CloudFront.

Continuous deployment

When developers push code to a repository, Amplify's continuous deployment pipeline enables them to automatically build and deploy their applications. This makes it simple to reliably and effectively deploy changes and updates to an application.

Setting up AWS Amplify CLI

First, you'll need to install the Amplify command line interface (CLI) on your local machine. This can be done with the following command:

npm install -g @aws-amplify/cli
Enter fullscreen mode Exit fullscreen mode

Next, you'll need to configure the CLI with your AWS credentials. You can do this by running the following command:

amplify configure
Enter fullscreen mode Exit fullscreen mode

Note that this will prompt you to sign in to your AWS administrator account via the console.

Upon signing in, you will be asked to create an IAM user and complete the creation using the AWS console as shown below;

Terminal showing AWS Amplify Configuration

The creation flow should look like this after each step;

IAM user creation flow

To create the user, click the "Create user" button, which then displays an AWS access key ID and secret access key credentials. You will be prompted to provide these credentials in your terminal in order to complete this configuration.

Once you have the CLI installed and configured, you're ready to start building your application.

Creating a new Amplify project

To create a new Amplify project, run the following command:

amplify init
Enter fullscreen mode Exit fullscreen mode

This will ask you to enter some information about your project, such as the name and environment. You'll also need to specify the type of project you're building, such as a web application or a mobile app.

Amplify Project

After you've created your project, you can start adding features like authentication, database, API to it using the amplify add <feature> command.

For example, you can add authentication by running the following command:

amplify add auth
Enter fullscreen mode Exit fullscreen mode

This will allow you to configure the authentication provider for your app, such as Amazon Cognito or Okta.

After you've added all the features you need, you can run amplify push to update the Amplify project's configuration to reflect the deployed changes.

Conclusion

In this article, you've learned about some of the key features of AWS Amplify, how to install the CLI and configure the platform. To further deepen your knowledge, you can visit the official documentation here.

Latest comments (0)