> ## Documentation Index
> Fetch the complete documentation index at: https://docs.operata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the Amazon Lex integration

> Deploy the CloudFormation stack that streams Amazon Lex V2 conversation events into Operata for correlation with Amazon Connect contacts.

Deploy the CloudFormation stack so your Amazon Lex V2 conversation events stream
from CloudWatch into Operata — a test contact that routes through your Lex bot
shows the bot's intents, slots, and fulfillment data in the Operata console
within five minutes of contact end.

## Before you start

* An [Amazon Connect integration](/docs/integrations-amazon-connect-overview)
  already streaming Contact Trace Records (CTRs).
* An [Operata account](/docs/get-started-overview) with Admin role and
  your Operata Group ID.
* AWS [IAM permissions](/docs/iam-policies) to deploy CloudFormation in
  the region hosting your Amazon Lex V2 bots.
* [Amazon Lex V2](https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html)
  bots wired into your Amazon Connect contact flows.
* [Lex conversation logging](https://docs.aws.amazon.com/lexv2/latest/dg/conversation-logs.html)
  enabled on each bot alias you want to monitor. Operata consumes text
  logs; audio logs are not required.

<Tip>
  Configure conversation logging per bot alias in the Amazon Lex V2
  console. Operata consumes the text-based log stream.
</Tip>

## Steps

### 1. Send Operata the install details

Contact [Operata Support](mailto:support@operata.com) with:

* **AWS region** hosting your Lex bots.
* **CloudWatch log group name** for the Lex conversation logs —
  usually `/aws/lex/<log-group-name>`. To find it for a specific bot,
  open the Amazon Lex console, select the bot, open **Deployment →
  Aliases**, and copy the **CloudWatch Log Group Name** value from the
  right-hand panel.
* **Operata Group ID** — Operata can confirm yours if you do not have
  it on hand.

Operata returns a quick-create CloudFormation link pre-filled with
your configuration.

### 2. Open the quick-create link

Click the link to open the [CloudFormation
console](https://console.aws.amazon.com/cloudformation). Every
parameter is pre-populated except the API key.

### 3. Enter your Operata API token

Paste an Operata API token into the **API key** parameter. Create one
in the Operata console under **Settings → Config → API**. See the
[Operata help article](https://help.operata.com/en/articles/5542797-how-do-i-create-view-change-and-revoke-api-tokens)
for the full lifecycle.

### 4. Deploy the stack

Acknowledge the IAM resource creation and click **Create stack**. The stack
reaches `CREATE_COMPLETE` in around five minutes. CloudFormation provisions:

| Resource                                                                                             | Quantity | Purpose                                                         |
| ---------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------- |
| [EventBridge Pipe](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html)           | 1        | Streams Lex conversation events to the Operata API destination. |
| [API Destination](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html) | 1        | The Operata API endpoint.                                       |
| [IAM Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)                           | 1        | Service-execution role for the Pipe.                            |
| [IAM Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)                | 2        | CloudWatch source access and API destination invocation.        |
| [Secrets Manager Secret](https://docs.aws.amazon.com/secretsmanager/)                                | 1        | The Operata API key.                                            |

### 5. (Optional) Tag the new resources

Apply your cost-allocation and ownership tags. See [Tag your AWS
resources](/docs/aws-tagging).

### 6. Place a test contact through the bot

Trigger a call that routes to your Lex bot through an Amazon Connect
contact flow. Interact by voice or DTMF as your flow expects. End the
contact cleanly.

## Verify

In the [Operata console](https://app.operata.io), open **Calls and
Logs → Summary** and locate the test contact. The Lex conversation
events appear within five minutes of contact end and join the Contact
Trace Record (CTR) by `ContactId`.

If nothing appears after five minutes, see [Troubleshooting](/docs/aws-troubleshooting).

## Data collected

Each event carries a Lex conversation log entry, including:

* Session ID and bot identifiers.
* Intent names and recognition confidence scores.
* Slot values (subject to redaction).
* Utterance text (subject to redaction).
* Session attributes.
* Fulfillment status and Lambda response data.
* Conversation timestamps.

For the full Lex log schema, see the
[AWS Lex logging reference](https://docs.aws.amazon.com/lexv2/latest/dg/security-logging-and-monitoring.html).

## Privacy

Raw Lex logs contain customer utterances and slot values. The
integration ships a redaction Lambda that runs in your AWS account
before any log leaves AWS. See:

* [Lex redaction schema](/docs/lex-privacy) — the field-tier schema and the mandatory keep-list.
* [Concept: Privacy and redaction](/docs/concepts-privacy-and-redaction) — the model the redaction Lambda enforces.

Contact [Operata Support](mailto:support@operata.com) for help selecting
a redaction configuration.

## Charges

All AWS service charges from this stack appear on your AWS bill. The Lex
integration is included in every Operata plan at no Operata cost.
Primary cost factors:

* EventBridge event processing.
* CloudWatch Logs data transfer out of CloudWatch.
* Secrets Manager (rolled into the API destination charge).

You may incur additional [AWS data-transfer charges](https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer)
for data leaving AWS to Operata.

## Deploying alongside other stacks

The Lex stack runs independently of the CTR, Contact Lens, and
contact-flow logs stacks. Add or remove any stack without affecting
the others.

## Related

* [Lex redaction schema](/docs/lex-privacy) — strip PII fields before logs leave AWS.
* [Install Contact Flow Logs collection](/docs/contact-flow-logs) — pair Lex bot data with the broader IVR path.
* [Concept: Cloud Collector](/docs/concepts-cloud-collector) — the Operata-side runtime that joins Lex events to contacts.
* [Troubleshoot the AWS integration](/docs/aws-troubleshooting) — missing events, IAM debugging, Amazon EventBridge Pipe failures.
