# Amazon Lex

### Integrate Amazon Lex

1. Select *Resources* from your workspace menu and choose *Integrations* card
2. Click *+ Add integration* > Choose Amazon Lex from the *Type* dropdown
3. Provide your integration a name
4. Click the *IAMrole and Lex V2 Service Role* > This takes you to AWS where you can log into your account. The *Quick create stack* page appears with *Template*, *Stack Name,* and *Parameters* information
5. In the *Capabilities* section at the bottom of that page, select the acknowledgement checkbox > Click the *Create stack* button&#x20;
6. Once the stack is created, click the *Output* tab > Under the *Key* section, locate your newly-generated values for *LexManagementRoleArn* and *LexV2ServiceLinkedRoleArn*&#x20;
7. Copy and paste those values into NLX in the *IAM Role ARN* and *Lex Service Role ARN* fields respectively
8. Click *Create integration*

### Optional: Enabling Sentiment

There is an additional one-time setup required in order to enable permissions to detect sentiment using Amazon Lex.  This adds the Comprehend permissions to the Lex service linked role that is created by the NLX - Lex Integration.

1. [Build and deploy](/platform/nlx-platform-guide/ai-applications/setup.md#deployment) an application using the desired Amazon Lex integration
2. Go to the Lex service in your AWS Console > Select your application from the Bots table
3. Under *Deployment*, select *Aliases*
4. Select the TestBotAlias
5. Click Edit and Enable Sentiment Analysis (Note: If sentiment analysis is already enabled, disable it, save, and re-enable it)
6. To confirm permission was successfully added, check the service linked IAM role for the ComprehendPolicy


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nlx.ai/platform/nlx-platform-guide/integrations/types/nlp-engines/amazon-lex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
