# Amazon Connect

To integrate your Amazon Lex bot in an Amazon Connect Virtual Contact Center, follow these instructions to utilize all available functionalities.

## Create a Lambda Function <a href="#create-a-lambda-function" id="create-a-lambda-function"></a>

Amazon Lex can't communicate directly with eva, therefore it needs a Lambda function to forward the payload to ava and then return the response in a special format to Amazon Lex.

<figure><img src="https://docs.eva.bot/voice-gateway/~gitbook/image?url=https%3A%2F%2F47336899-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fp0SUdPEICXSM7gLqSIa9%252Fuploads%252F9wj0mygzZ80dJeAPfMX9%252Fimage.png%3Falt%3Dmedia%26token%3D51dccedb-d417-420b-80b7-0994ef655ca5&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ae556a04&#x26;sv=2" alt=""><figcaption></figcaption></figure>

When using the Amazon Lex bot for NLU, we forward the entire NLU response 1:1 to eva, and then the built-in Amazon Lex NLU in Cognigy.AI will transform the transcript, Intents and Slots into a format that can be understood by eva

### Configure the Lambda to connect eva <a href="#configure-the-lambda-to-connect-eva" id="configure-the-lambda-to-connect-eva"></a>

1. Log on to the [AWS console](https://console.aws.amazon.com/) as a privileged user.
2. Open [AWS Lambda](https://support.cognigy.com/hc/en-us/articles/console.aws.amazon.com/lambda) and create a new Lambda function with a Node.js runtime.
3. Create your lambda that communicates with eva (you can ask for the OIL template). You will need to configurate the environment variables for the credentials and bot configuration (user, password, api-key, project, channel…)
4. Modify the service that was created for the Lambda function. You will need to add the rights lex:ListIntents and lex:ListSlots. Instead you may also use a predefined role such as AmazonLexReadOnly.
5. Save the Lambda function.

### Configure the created Lambda in Lex <a href="#configure-the-created-lambda-in-lex" id="configure-the-created-lambda-in-lex"></a>

1. Log on to the [AWS console ](https://console.aws.amazon.com/)with a privileged user.
2. Open your bot in the [AWS Lex V2 console](https://console.aws.amazon.com/lexv2).
3. Open your first Intent.

Expand Fulfillment and enable the Fulfillment Lambda code hook in the Advanced options. 

<figure><img src="https://docs.eva.bot/voice-gateway/~gitbook/image?url=https%3A%2F%2F47336899-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fp0SUdPEICXSM7gLqSIa9%252Fuploads%252FQx6gEkoIqV6Cs8NTWJpN%252Fimage.png%3Falt%3Dmedia%26token%3D59b2e81c-91d3-422a-8d7f-8ed5708c89ea&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ed1e33b0&#x26;sv=2" alt=""><figcaption></figcaption></figure>

5. Click Update Options and Save intent.
6. Open each Intent in the current language, including the FallbackIntent, and repeat these steps.
7. Build the language, then repeat these steps for additional languages if required.
8. Go to Bot versions and create a new version.
9. Go to Aliases and create a new alias or associate an existing one to the newest version.
10. Reopen the alias and click on the name of each language that is supported 

<figure><img src="https://docs.eva.bot/voice-gateway/~gitbook/image?url=https%3A%2F%2F47336899-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fp0SUdPEICXSM7gLqSIa9%252Fuploads%252Fku2BiydgKXybIGtrP1x6%252Fimage.png%3Falt%3Dmedia%26token%3D00284b6c-7ce3-4a77-812e-9cfc454b597d&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d9234870&#x26;sv=2" alt=""><figcaption></figcaption></figure>

11. Select the previously created Lambda function with its latest version and save


---

# 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.conversational-ai.syntphony.com/user-guide/voice-gateway/amazon-connect.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.
