Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions src/fragments/cli-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
## Configuring the Amplify CLI

To set up the Amplify CLI on your local machine, you have to configure it to connect to your AWS account.

> If you already have an AWS profile with credentials on your machine, you can skip this step.

> If you are using CLI version < 10.8.0 go to [Configure CLI < 10.8.0](#configure-the-amplify-cli-version--1080)

Configure Amplify by running the following command:

```bash
amplify configure
```

`amplify configure` will ask you to sign into the AWS Console.

Once you're signed in, Amplify CLI will ask you to create an IAM user.

> Amazon IAM (Identity and Access Management) enables you to manage users and user permissions in AWS. You can learn more about Amazon IAM [here](https://aws.amazon.com/iam/).

```console
Specify the AWS Region
? region: # Your preferred region
Follow the instructions at
https://docs.amplify.aws/cli/start/install/#configure-the-amplify-cli

to complete the user creation in the AWS console
https://console.aws.amazon.com/iamv2/home#/users/create
```

Navigate to the [IAM User creation page](https://console.aws.amazon.com/iamv2/home#/users/create) if it's not already open.

Enter a User name and select **Next**. You can name the user anything but we'll call it "amplify-dev".

![image](/images/cli/user-creation/user-name.png)

Select **Attach policies directly** and select **AdministratorAccess-Amplify** as the Permissions policy. Select **Next**.

![image](/images/cli/user-creation/user-permissions.png)

On the Review page, check that everything looks good and select **Create user**.

![image](/images/cli/user-creation/user-review.png)

This will redirect to the users list page. Select the user you just created.

![image](/images/cli/user-creation/user-list.png)

On the user details page, navigate to the **Security credentials** tab, scroll down to **Access keys** and select **Create access keys**.

![image](/images/cli/user-creation/create-access-keys.png)

On the next page, select **Command Line Interface**, acknowledge the warning, and select **Next**.

![image](/images/cli/user-creation/ack-page.png)

On the next page select **Create access key**. You’ll then see a page with the access keys for the user. Use the copy icon to copy these values to your clipboard, then return to the Amplify CLI.

![image](/images/cli/user-creation/access-keys-done.png)

Enter the values you just copied into the corresponding CLI prompts.

```console
Enter the access key of the newly created user:
? accessKeyId: # YOUR_ACCESS_KEY_ID
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
This would update/create the AWS Profile in your local machine
? Profile Name: # (default)

Successfully set up the new user.
```

## Configure the Amplify CLI version < 10.8.0

### Option 1: Watch the video guide

Watch the video below to learn how to install and configure the Amplify CLI or skip to the next section to follow the step-by-step instructions.

<iframe
src="https://www.youtube-nocookie.com/embed/fWbM5DLh25U"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

### Option 2: Follow the instructions

Configure Amplify by running the following command:

```bash
amplify configure
```

`amplify configure` will ask you to sign into the AWS Console.

Once you're signed in, Amplify CLI will ask you to create an IAM user.

> Amazon IAM (Identity and Access Management) enables you to manage users and user permissions in AWS. You can learn more about Amazon IAM [here](https://aws.amazon.com/iam/).

```console
Specify the AWS Region
? region: # Your preferred region
Specify the username of the new IAM user:
? user name: # User name for Amplify IAM user
Complete the user creation using the AWS console
```

Create a user with `AdministratorAccess-Amplify` to your account to provision AWS resources for you like AppSync, Cognito etc.

![image](/images/user-creation.gif)

Once the user is created, Amplify CLI will ask you to provide the `accessKeyId` and the `secretAccessKey` to connect Amplify CLI with your newly created IAM user.

```console
Enter the access key of the newly created user:
? accessKeyId: # YOUR_ACCESS_KEY_ID
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
This would update/create the AWS Profile in your local machine
? Profile Name: # (default)

Successfully set up the new user.
```
<Callout>

It is recommended to create a new IAM user for every device that installs the Amplify CLI, rather than attempt to use an existing IAM user used on another device. Having a distinct user for each machine provides the best level of visibility and control without breaking the deployment of your app, allowing for the quick deactivation of an individual machine if needed.

</Callout>
Original file line number Diff line number Diff line change
@@ -1,64 +1,4 @@
## Sign up for an AWS account

If you don't already have an AWS account, you'll need to create one in order to follow the steps outlined in this tutorial.

[Create AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation#/start)

> There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier.

## Install and configure the Amplify CLI

The Amplify Command Line Interface (CLI) is a unified toolchain to create AWS cloud services for your app. Let's go ahead and install the Amplify CLI.

### Option 1: Watch the video guide

Watch the video below to learn how to install and configure the Amplify CLI or skip to the next section to follow the step-by-step instructions.

<iframe src="https://www.youtube-nocookie.com/embed/fWbM5DLh25U" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

### Option 2: Follow the instructions

import ios0 from "/src/fragments/lib-v1/project-setup/native_common/prereq/cliInstall.mdx";

<Fragments fragments={{ios: ios0}} />

import android1 from "/src/fragments/lib-v1/project-setup/native_common/prereq/cliInstall.mdx";

<Fragments fragments={{android: android1}} />

Now it's time to setup the Amplify CLI. Configure Amplify by running the following command:

```bash
amplify configure
```

`amplify configure` will ask you to sign into the AWS Console.

Once you're signed in, Amplify CLI will ask you to create an IAM user.
> Amazon IAM (Identity and Access Management) enables you to manage users and user permissions in AWS. You can learn more about Amazon IAM [here](https://aws.amazon.com/iam/).

```console
Specify the AWS Region
? region: # Your preferred region
Specify the username of the new IAM user:
? user name: # User name for Amplify IAM user
Complete the user creation using the AWS console
```

Create a user with `AdministratorAccess-Amplify` to your account to provision AWS resources for you like AppSync, Cognito etc.

![image](/images/user-creation.gif)

Once the user is created, Amplify CLI will ask you to provide the `accessKeyId` and the `secretAccessKey` to connect Amplify CLI with your newly created IAM user.

```console
Enter the access key of the newly created user:
? accessKeyId: # YOUR_ACCESS_KEY_ID
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
This would update/create the AWS Profile in your local machine
? Profile Name: # (default)

Successfully set up the new user.
```
import config from '/src/fragments/cli-config.mdx';

<Fragments fragments={{ all: config }} />
Next, you'll set up the app and initialize Amplify!
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,8 @@ If you don't already have an AWS account, you'll need to create one in order to

## Install and configure the Amplify CLI

The Amplify Command Line Interface (CLI) is a unified toolchain to create AWS cloud services for your app. Let's go ahead and install the Amplify CLI.
import config from '/src/fragments/cli-config.mdx';

### Option 1: Watch the video guide

Watch the video below to learn how to install and configure the Amplify CLI or skip to the next section to follow the step-by-step instructions.

<iframe
src="https://www.youtube-nocookie.com/embed/fWbM5DLh25U"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

### Option 2: Follow the instructions

import cliInstallBlock from '/src/fragments/cli-install-block.mdx';

<Fragments fragments={{ all: cliInstallBlock }} />

Now it's time to setup the Amplify CLI. Configure Amplify by running the following command:

```bash
amplify configure
```

`amplify configure` will ask you to sign into the AWS Console.

Once you're signed in, Amplify CLI will ask you to create an IAM user.

> Amazon IAM (Identity and Access Management) enables you to manage users and user permissions in AWS. You can learn more about Amazon IAM [here](https://aws.amazon.com/iam/).

```console
Specify the AWS Region
? region: # Your preferred region
Specify the username of the new IAM user:
? user name: # User name for Amplify IAM user
Complete the user creation using the AWS console
```

Create a user with AWS managed policy `AdministratorAccess-Amplify` in your account. It will be used to provision AWS resources for you like AppSync, Cognito etc.

![image](/images/user-creation.gif)

Once the user is created, Amplify CLI will ask you to provide the `accessKeyId` and the `secretAccessKey` to connect Amplify CLI with your newly created IAM user.

```console
Enter the access key of the newly created user:
? accessKeyId: # YOUR_ACCESS_KEY_ID
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
This would update/create the AWS Profile in your local machine
? Profile Name: # (default)

Successfully set up the new user.
```
<Fragments fragments={{ all: config }} />

Next, you'll set up the app and initialize Amplify!
54 changes: 2 additions & 52 deletions src/fragments/start/getting-started/common/prereq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,10 @@ If you don't already have an AWS account, you'll need to create one in order to

> There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier.

## Install and configure the Amplify CLI

The Amplify Command Line Interface (CLI) is a unified toolchain to create AWS cloud services for your app. Let's go ahead and install the Amplify CLI.
import config from '/src/fragments/cli-config.mdx';

### Option 1: Watch the video guide

Watch the video below to learn how to install and configure the Amplify CLI or skip to the next section to follow the step-by-step instructions.

<iframe
src="https://www.youtube-nocookie.com/embed/fWbM5DLh25U"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

### Option 2: Follow the instructions

import all0 from '/src/fragments/cli-install-block.mdx';

<Fragments fragments={{ all: all0 }} />

Now it's time to setup the Amplify CLI. Configure Amplify by running the following command:

```bash
amplify configure
```

`amplify configure` will ask you to sign into the AWS Console.

Once you're signed in, Amplify CLI will ask you to create an IAM user.

> Amazon IAM (Identity and Access Management) enables you to manage users and user permissions in AWS. You can learn more about Amazon IAM [here](https://aws.amazon.com/iam/).

```console
Specify the AWS Region
? region: <Your preferred region>
Specify the username of the new IAM user:
? user name: <User name for Amplify IAM user>
Complete the user creation using the AWS console: <URL>
```

Follow the `<URL>` and create a user with `AdministratorAccess-Amplify` to your account to provision AWS resources for you like AppSync, Cognito etc.

![image](/images/user-creation.gif)

Amplify CLI will then ask you to copy and paste the `accessKeyId` and the `secretAccessKey` from your newly created IAM user to connect with Amplify CLI.

```console
Enter the access key of the newly created user:
? accessKeyId: <ACCESSKEYID>
? secretAccessKey: <ACCESSKEY>
This would update/create the AWS Profile in your local machine
? Profile Name: default
```
<Fragments fragments={{ all: config }} />

Successfully set up the new user.

Expand Down
Loading