Resource: aws_lex_bot

Provides an Amazon Lex Bot resource. For more information see Amazon Lex: How It Works

Example Usage

resource "aws_lex_bot" "order_flowers_bot" {
  abort_statement {
    message {
      content      = "Sorry, I am not able to assist at this time"
      content_type = "PlainText"
    }
  }

  child_directed = false

  clarification_prompt {
    max_attempts = 2

    message {
      content      = "I didn't understand you, what would you like to do?"
      content_type = "PlainText"
    }
  }

  create_version              = false
  description                 = "Bot to order flowers on the behalf of a user"
  idle_session_ttl_in_seconds = 600

  intent {
    intent_name    = "OrderFlowers"
    intent_version = "1"
  }

  locale           = "en-US"
  name             = "OrderFlowers"
  process_behavior = "BUILD"
  voice_id         = "Salli"
}

Argument Reference

This resource supports the following arguments:

intent

Identifies the specific version of an intent.

message

The message object that provides the message text and its type.

prompt

Obtains information from the user. To define a prompt, provide one or more messages and specify the number of attempts to get information from the user. If you provide more than one message, Amazon Lex chooses one of the messages to use to prompt the user.

statement

A statement is a map with a set of message maps and an optional response card string. Messages convey information to the user. At runtime, Amazon Lex selects the message to convey.

Timeouts

Configuration options:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import bots using their name. For example:

import {
  to = aws_lex_bot.order_flowers_bot
  id = "OrderFlowers"
}

Using terraform import, import bots using their name. For example:

% terraform import aws_lex_bot.order_flowers_bot OrderFlowers