If you are using Amazon Lex V2, refer to the Amazon Lex V2 guide instead.
If you are using Amazon Lex V1, we recommend upgrading your bots to Amazon Lex V2. We are no longer adding new features to V1 and strongly recommend using V2 for all new bots.
Step 4: Set up Amazon Cognito
To manage permissions and users for the web application, you need to set up Amazon Cognito. Amazon Cognito ensures that the web application is secure and has access control. Amazon Cognito uses identity pools to provide AWS credentials that grant your users access to other AWS services. For this tutorial, it provides access to Amazon Lex.
When creating an identity pool, Amazon Cognito provides you with AWS Identity and Access Management (IAM) roles for authenticated and unauthenticated users. You modify the IAM roles by adding policies that grant access to Amazon Lex.
To set up Amazon Cognito
-
Sign into the AWS Management Console and open the Amazon Cognito console at https://console.aws.amazon.com/cognito/
. -
Choose Manage Identity Pools.
-
Choose Create new identity pool.
-
Configure the identity pool.
-
Identity pool name – Enter a name that indicates the pool's purpose, such as
BotPool
. -
In the Unauthenticated identities section, choose Enable access to unauthenticated identities.
-
-
Choose Create Pool.
-
On the Identify the IAM roles to use with your new identity pool page, choose View Details.
-
Record the IAM role names. You will modify them later.
-
Choose Allow.
-
On the Getting Started with Amazon Cognito page, for Platform, choose JavaScript.
-
In the Get AWS Credentials section, find and record the Identity pool ID.
-
To allow access to Amazon Lex, modify the authenticated and unauthenticated IAM roles.
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
. -
In the navigation pane, under Access Management, choose Roles.
-
In the search box, enter the name of the authenticated IAM role and choose the checkbox next to it.
-
Choose Attach policies.
-
In the search box, enter
AmazonLexRunBotsOnly
and choose the checkbox next to it. -
Choose Attach policy.
-
-
Enter the name of the unauthenticated IAM role in the search box and choose the checkbox next to it.
-
Choose Attach policies.
-
In the search box, enter
AmazonLexRunBotsOnly
and choose the checkbox next to it. -
Choose Attach policy.
-
Next step
Step 5: Deploy Your Bot as a Web Application