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: tuts/040-qbusiness-ica/qbusiness-ica.md
+30-29Lines changed: 30 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,13 @@ The total cost for running the resources in this tutorial for one hour is approx
26
26
27
27
Amazon Q Business uses IAM Identity Center for user management. In this step, you'll check if you have an IAM Identity Center instance and create one if needed.
28
28
29
-
First, check if you already have an IAM Identity Center instance:
29
+
First, check if you already have an IAM Identity Center instance. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
30
30
31
31
```bash
32
32
aws sso-admin list-instances --region us-east-1 --query 'Instances[0].InstanceArn' --output text
33
33
```
34
34
35
-
If the command returns "None" or an empty result, you need to create an IAM Identity Center instance:
35
+
If the command returns "None" or an empty result, you need to create an IAM Identity Center instance. Replace "us-east-1" with the AWS Region where you want to create your IAM Identity Center instance.
@@ -48,7 +48,7 @@ Amazon Q Business requires IAM roles and policies to function properly. In this
48
48
49
49
First, create a trust policy file that allows Amazon Q Business to assume the role:
50
50
51
-
Note: For this tutorial, replace "123456789012" with your AWS account ID. Replace "us-east-1" with the AWS Region name of your Identity Center instance.
51
+
Note: For this tutorial, replace "123456789012" with your AWS account ID. Replace "us-east-1" with the AWS Region name that you plan to use.
52
52
53
53
```bash
54
54
cat > qbusiness-trust-policy.json <<EOF
@@ -78,7 +78,7 @@ EOF
78
78
79
79
Next, create a permissions policy file that defines what actions the role can perform.
80
80
81
-
Note: For this tutorial, replace "123456789012" with your AWS account number.
81
+
Note: For this tutorial, replace "123456789012" with your AWS account number. Replace "us-east-1" with the AWS Region name that you plan to use.
Now, create the IAM role using the trust policy. Replace "us-east-1" with the AWS Region name that you plan to use.
137
137
138
138
```bash
139
139
aws iam create-role \
@@ -144,7 +144,7 @@ aws iam create-role \
144
144
--output text
145
145
```
146
146
147
-
Create an IAM policy using the permissions policy file:
147
+
Create an IAM policy using the permissions policy file. Replace "us-east-1" with the AWS Region name that you plan to use.
148
148
149
149
```bash
150
150
aws iam create-policy \
@@ -155,7 +155,7 @@ aws iam create-policy \
155
155
--output text
156
156
```
157
157
158
-
Attach the policy to the role. Replace "123456789012" with your AWS account number.
158
+
Attach the policy to the role. Replace "123456789012" with your AWS account number. Replace "us-east-1" with the AWS Region name that you plan to use.
159
159
160
160
```bash
161
161
aws iam attach-role-policy \
@@ -172,7 +172,7 @@ Before creating the Amazon Q Business application, you need to set up a user in
172
172
173
173
First, get the Identity Store ID associated with your IAM Identity Center instance.
174
174
175
-
Replace "arn:aws:sso:::instance/ssoins-abcd1234xmpl" with the ARN of your IAM Identity Center instance.
175
+
Replace "arn:aws:sso:::instance/ssoins-abcd1234xmpl" with the ARN of your IAM Identity Center instance. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
Make a note of the Identity Store ID in the response. You'll use it in the following command.
186
186
187
-
Now, create a user in the Identity Store. Replace "d-abcd1234xmpl" with your actual Identity Store ID.
187
+
Now, create a user in the Identity Store. Replace "d-abcd1234xmpl" with your actual Identity Store ID. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
188
188
Note: In a production environment, use valid email addresses from your organization's domain instead of example.com.
189
189
190
190
```bash
@@ -207,7 +207,7 @@ This command creates a user in IAM Identity Center and returns the user ID. Save
207
207
208
208
Now you're ready to create the Amazon Q Business application.
209
209
210
-
Create the application using the following command. Replace "arn:aws:sso:::instance/ssoins-abcd1234xmpl" with your actual IAM Identity Center instance ARN. Replace "123456789012" with your AWS account number.
210
+
Create the application using the following command. Replace "arn:aws:sso:::instance/ssoins-abcd1234xmpl" with your actual IAM Identity Center instance ARN. Replace "123456789012" with your AWS account number. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
211
211
212
212
```bash
213
213
aws qbusiness create-application \
@@ -225,7 +225,7 @@ This command creates an Amazon Q Business application and returns the applicatio
225
225
226
226
After creating the application, wait for it to be fully provisioned (approximately 30 seconds).
227
227
228
-
Next, get the application ARN from IAM Identity Center:
228
+
Next, get the application ARN from IAM Identity Center. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
229
229
230
230
```bash
231
231
aws sso-admin list-applications \
@@ -239,7 +239,7 @@ If the command doesn't return an ARN immediately, wait a few seconds and try aga
239
239
240
240
## Step 5: Enable creator mode (LLM direct chat)
241
241
242
-
To allow users to chat directly with the LLM without creating an index, you need to enable creator mode. Replace "app-abcd1234xmpl" with your actual application ID from Step 4.
242
+
To allow users to chat directly with the LLM without creating an index, you need to enable creator mode. Replace "app-abcd1234xmpl" with your actual application ID from Step 4. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
Now that you have both the user and the application created, you need to assign the user to the application. Replace "arn:aws:sso::123456789012:application/ssoins-abcd1234xmpl/apl-abcd1234xmpl" with your application ARN. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3.
255
+
Now that you have both the user and the application created, you need to assign the user to the application. Replace "arn:aws:sso::123456789012:application/ssoins-abcd1234xmpl/apl-abcd1234xmpl" with your application ARN. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
256
256
257
257
```bash
258
258
aws sso-admin create-application-assignment \
@@ -266,7 +266,7 @@ This command assigns the user to the Amazon Q Business application, allowing the
266
266
267
267
## Step 7: Create a user subscription
268
268
269
-
After assigning the user to the application, you need to create a subscription that determines their access level. Replace "app-abcd1234xmpl" with the application ID that's returned in Step 4. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3.
269
+
After assigning the user to the application, you need to create a subscription that determines their access level. Replace "app-abcd1234xmpl" with the application ID that's returned in Step 4. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
270
270
271
271
```bash
272
272
aws qbusiness create-subscription \
@@ -284,7 +284,7 @@ This command creates a full Q Business subscription for the user, giving them fu
284
284
285
285
To provide a web interface for your Amazon Q Business application, you can create a web experience.
286
286
287
-
First, create a trust policy file for the web experience role. Replace "123456789012" with your AWS account number. Replace "app-abcd1234xmpl" with the Q Business application ID that's returned from Step 4.
287
+
First, create a trust policy file for the web experience role. Replace "123456789012" with your AWS account number. Replace "app-abcd1234xmpl" with the Q Business application ID that's returned from Step 4. Replace "us-east-1" with the AWS Region of your Q Business application.
Next, create a permissions policy file for the web experience. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4 and replace "123456789012" with your AWS account ID.
318
+
Next, create a permissions policy file for the web experience. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4 and replace "123456789012" with your AWS account ID. Replace "us-east-1" with the AWS Region of your Q Business Application.
Create the IAM role for the web experience. Replace "us-east-1" with the AWS Region name that you plan to use.
490
490
491
491
```bash
492
492
aws iam create-role \
@@ -497,7 +497,7 @@ aws iam create-role \
497
497
--output text
498
498
```
499
499
500
-
Create an IAM policy for the web experience:
500
+
Create an IAM policy for the web experience. Replace "us-east-1" with the AWS Region name that you plan to use.
501
501
502
502
```bash
503
503
aws iam create-policy \
@@ -508,7 +508,7 @@ aws iam create-policy \
508
508
--output text
509
509
```
510
510
511
-
Attach the policy to the role. Replace "123456789012" with the AWS account number.
511
+
Attach the policy to the role. Replace "123456789012" with the AWS account number. Replace "us-east-1" with the AWS Region name that you plan to use.
512
512
513
513
```bash
514
514
aws iam attach-role-policy \
@@ -519,7 +519,7 @@ aws iam attach-role-policy \
519
519
520
520
After creating the role and policy, wait for them to propagate (approximately 15 seconds).
521
521
522
-
Now, create the web experience. Replace "123456789012" with the AWS account number. Replace "app-abcd1234xmpl" with the name of your application ID that's returned from Step 4.
522
+
Now, create the web experience. Replace "123456789012" with the AWS account number. Replace "app-abcd1234xmpl" with the name of your application ID that's returned from Step 4. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
This command creates a web experience for your Amazon Q Business application and returns the web experience ID. Save the web experience id for the following command to use.
534
534
535
-
To get the URL for the web experience. Replace "app-abcd1234xmpl" with the name of your application ID that's returned from Step 4. Replace "wex-abcd1234xmpl" with your actual web experience id.
535
+
To get the URL for the web experience. Replace "app-abcd1234xmpl" with the name of your application ID that's returned from Step 4. Replace "wex-abcd1234xmpl" with your actual web experience id. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
536
536
537
537
```bash
538
538
aws qbusiness get-web-experience \
@@ -551,19 +551,19 @@ To sign in and access the URL through a web browser, for username, use the user-
551
551
552
552
To verify that your Amazon Q Business application has been created successfully, you can use the following commands. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4.
553
553
554
-
Check the application details:
554
+
Check the application details. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
If you created a web experience, list the web experiences:
566
+
If you created a web experience, list the web experiences. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
To avoid ongoing charges for the resources created in this tutorial, you should delete them when you're done.
575
575
576
-
If you created a web experience, delete it first. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4 and replace "wex-abcd1234xmpl" with your actual web experience ID that's returned in Step 8.
576
+
If you created a web experience, delete it first. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4 and replace "wex-abcd1234xmpl" with your actual web experience ID that's returned in Step 8. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
Delete the user assignment. Replace "arn:aws:sso::123456789012:application/ssoins-abcd1234xmpl/apl-abcd1234xmpl" with your application ARN that's returned from Step 4. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3.
585
+
Delete the user assignment. Replace "arn:aws:sso::123456789012:application/ssoins-abcd1234xmpl/apl-abcd1234xmpl" with your application ARN that's returned from Step 4. Replace "1234abcd-xmpl-5678-efgh-90ijklmnopqr" with the user ID that's returned in Step 3. Replace "us-east-1" with the AWS Region where your IAM Identity Center instance is located.
Delete the Amazon Q Business application. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4.
595
+
Delete the Amazon Q Business application. Replace "app-abcd1234xmpl" with your actual application ID that's returned in Step 4. Replace "us-east-1" with the AWS Region where your Amazon Q Business application is located.
If you created a web experience role and policy, clean them up. Replace "123456789012" with your AWS account number.
601
+
If you created a web experience role and policy, clean them up. Replace "123456789012" with your AWS account number. Replace "us-east-1" with the AWS Region name of your web experience role and policy.
aws iam delete-policy --region us-east-1 --policy-arn "arn:aws:iam::123456789012:policy/QBusinessWebPolicy-abcd1234"
612
612
```
613
613
614
-
Finally, clean up the service role and policy. Replace "123456789012" with your AWS account number.
614
+
Finally, clean up the main application role and policy that are created in Step 2. Replace "123456789012" with your AWS account number. Replace "us-east-1" with the AWS Region name of your web experience role and policy.
0 commit comments