You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fragments/cli-config.mdx
+74-8Lines changed: 74 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,29 @@
2
2
3
3
To set up the Amplify CLI on your local machine, you have to configure it to connect to your AWS account.
4
4
5
-
> If you already have an AWS profile with credentials on your machine, you can skip this step.
5
+
<Calloutinfo>
6
+
7
+
**Note**: If you already have an AWS profile with credentials on your machine, you can skip this step.
8
+
9
+
</Callout>
6
10
7
11
Configure Amplify by running the following command:
8
12
9
-
```bash
13
+
```bash title="Terminal"
10
14
amplify configure
11
15
```
12
16
13
-
`amplify configure` will ask you to sign into the AWS Console.
17
+
<Calloutinfo>
14
18
15
-
Once you're signed in, Amplify CLI will ask you to create an IAM user.
19
+
The `configure` command only supports creating AWS profiles that use permanent credentials. If you are using an IAM role or IAM Identity Center (previously AWS SSO), [learn how to configure Amplify CLI manually](#manually-configure-the-amplify-cli)
20
+
21
+
</Callout>
22
+
23
+
`amplify configure` will ask you to sign into the AWS Console.
16
24
17
-
> 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/).
25
+
Once you're signed in, Amplify CLI will ask you to use the [AWS Identity and Access Management (IAM)](https://aws.amazon.com/iam/) to create an IAM user.
18
26
19
-
```console
27
+
```console title="Terminal"
20
28
Specify the AWS Region
21
29
? region: # Your preferred region
22
30
Follow the instructions at
@@ -52,13 +60,13 @@ On the next page, select **Command Line Interface**, acknowledge the warning, an
52
60
53
61

54
62
55
-
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.
63
+
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.
56
64
57
65

58
66
59
67
Enter the values you just copied into the corresponding CLI prompts.
60
68
61
-
```console
69
+
```console title="Terminal"
62
70
Enter the access key of the newly created user:
63
71
? accessKeyId: # YOUR_ACCESS_KEY_ID
64
72
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
@@ -67,3 +75,61 @@ This would update/create the AWS Profile in your local machine
67
75
68
76
Successfully set up the new user.
69
77
```
78
+
79
+
## Manually configure the Amplify CLI
80
+
81
+
If you are using an IAM role or IAM Identity Center (previously AWS SSO), you can configure your local machine for use with Amplify CLI by creating [AWS profile entries](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-format-profile) manually rather than the `amplify configure` wizard.
82
+
83
+
To create an AWS profile locally using IAM Identity Center, you can use the AWS CLI wizard, [`aws configure sso`](https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html#sso-configure-profile-token-auto-sso), or write to `~/.aws/config` directly:
84
+
85
+
<Calloutinfo>
86
+
87
+
[Learn how to install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
Currently, the Amplify CLI requires a workaround for use with IAM Identity Center due to [an issue in how it resolves credentials](https://github.com/aws-amplify/amplify-cli/issues/4488).
Using the example above, when creating a new app or pulling an existing app, specify `my-sso-profile` as the AWS profile you'd like to use with the Amplify app.
123
+
124
+
To create [an AWS profile locally using an IAM role](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html), assign the `AdministratorAccess-Amplify` permissions set to the role and set the role in your `~/.aws/config` file:
Using the example above, when creating a new app or pulling an existing app, specify `amplify-admin` as the AWS profile you'd like to use with the Amplify app
0 commit comments