Skip to content

Commit 4a1a319

Browse files
authored
add callout for sso use, manual configuration instructions (aws-amplify#6752)
* add callout for sso use, manual configuration instructions * minor correction * minor correction * code snippet titles * role name change
1 parent daa4d7f commit 4a1a319

File tree

1 file changed

+72
-6
lines changed
  • src/pages/[platform]/start/getting-started/installation

1 file changed

+72
-6
lines changed

src/pages/[platform]/start/getting-started/installation/index.mdx

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,27 @@ curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd &&
121121

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

124-
> If you already have an AWS profile with credentials on your machine, you can skip this step.
124+
<Callout info>
125+
126+
**Note**: If you already have an AWS profile with credentials on your machine, you can skip this step.
127+
128+
</Callout>
125129

126130
Configure Amplify by running the following command:
127131

128132
```bash
129133
amplify configure
130134
```
131135

132-
`amplify configure` will ask you to sign into the AWS Console.
136+
<Callout info>
133137

134-
Once you're signed in, Amplify CLI will ask you to create an IAM user.
138+
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)
135139

136-
> 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/).
140+
</Callout>
141+
142+
`amplify configure` will ask you to sign into the AWS Console.
143+
144+
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.
137145

138146
```console
139147
Specify the AWS Region
@@ -171,7 +179,7 @@ On the next page, select **Command Line Interface**, acknowledge the warning, an
171179

172180
![Command Line Interface option selected on the options list.](/images/cli/user-creation/ack-page.png)
173181

174-
On the next page select **Create access key**. Youll 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.
182+
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.
175183

176184
![Retrieve access keys page with access key and secret access key copy buttons circled.](/images/cli/user-creation/access-keys-done.png)
177185

@@ -187,4 +195,62 @@ This would update/create the AWS Profile in your local machine
187195
Successfully set up the new user.
188196
```
189197

190-
In the next section, you'll set up the app and initialize Amplify.
198+
On the next page, you'll set up the app and initialize Amplify.
199+
200+
## Manually configure the Amplify CLI
201+
202+
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.
203+
204+
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:
205+
206+
<Callout info>
207+
208+
[Learn how to install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
209+
210+
</Callout>
211+
212+
```toml title="~/.aws/config"
213+
[profile my-sso-profile]
214+
sso_session = my-sso
215+
sso_account_id = 123456789011
216+
sso_role_name = AdministratorAccess-Amplify
217+
region = us-west-2
218+
output = json
219+
220+
[sso-session my-sso]
221+
sso_region = us-east-1
222+
sso_start_url = https://my-sso-portal.awsapps.com/start
223+
sso_registration_scopes = sso:account:access
224+
```
225+
226+
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).
227+
228+
```diff title="~/.aws/config"
229+
[profile my-sso-profile]
230+
sso_session = my-sso
231+
sso_account_id = 123456789011
232+
sso_role_name = AdministratorAccess-Amplify
233+
region = us-west-2
234+
output = json
235+
+ credential_process = aws configure export-credentials --profile my-sso-profile
236+
237+
[sso-session my-sso]
238+
sso_region = us-east-1
239+
sso_start_url = https://my-sso-portal.awsapps.com/start
240+
sso_registration_scopes = sso:account:access
241+
```
242+
243+
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.
244+
245+
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:
246+
247+
```toml title="~/.aws/config"
248+
[profile amplify-admin]
249+
role_arn = arn:aws:iam::123456789012:role/amplify-admin
250+
source_profile = amplify-user
251+
252+
[profile amplify-user]
253+
region=us-east-1
254+
```
255+
256+
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

Comments
 (0)