Bot class

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const orderFlowersBot = new aws.lex.Bot("order_flowers_bot", {
    abortStatement: {
        messages: [{
            content: "Sorry, I am not able to assist at this time",
            contentType: "PlainText",
        }],
    },
    clarificationPrompt: {
        messages: [{
            content: "I didn't understand you, what would you like to do?",
            contentType: "PlainText",
        }],
        maxAttempts: 2,
    },
    intents: [{
        intentName: "OrderFlowers",
        intentVersion: "1",
    }],
    childDirected: false,
    createVersion: false,
    description: "Bot to order flowers on the behalf of a user",
    idleSessionTtlInSeconds: 600,
    locale: "en-US",
    name: "OrderFlowers",
    processBehavior: "BUILD",
    voiceId: "Salli",
});
import pulumi
import pulumi_aws as aws

order_flowers_bot = aws.lex.Bot("order_flowers_bot",
    abort_statement={
        "messages": [{
            "content": "Sorry, I am not able to assist at this time",
            "content_type": "PlainText",
        }],
    },
    clarification_prompt={
        "messages": [{
            "content": "I didn't understand you, what would you like to do?",
            "content_type": "PlainText",
        }],
        "max_attempts": 2,
    },
    intents=[{
        "intent_name": "OrderFlowers",
        "intent_version": "1",
    }],
    child_directed=False,
    create_version=False,
    description="Bot to order flowers on the behalf of a user",
    idle_session_ttl_in_seconds=600,
    locale="en-US",
    name="OrderFlowers",
    process_behavior="BUILD",
    voice_id="Salli")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var orderFlowersBot = new Aws.Lex.Bot("order_flowers_bot", new()
    {
        AbortStatement = new Aws.Lex.Inputs.BotAbortStatementArgs
        {
            Messages = new[]
            {
                new Aws.Lex.Inputs.BotAbortStatementMessageArgs
                {
                    Content = "Sorry, I am not able to assist at this time",
                    ContentType = "PlainText",
                },
            },
        },
        ClarificationPrompt = new Aws.Lex.Inputs.BotClarificationPromptArgs
        {
            Messages = new[]
            {
                new Aws.Lex.Inputs.BotClarificationPromptMessageArgs
                {
                    Content = "I didn't understand you, what would you like to do?",
                    ContentType = "PlainText",
                },
            },
            MaxAttempts = 2,
        },
        Intents = new[]
        {
            new Aws.Lex.Inputs.BotIntentArgs
            {
                IntentName = "OrderFlowers",
                IntentVersion = "1",
            },
        },
        ChildDirected = false,
        CreateVersion = false,
        Description = "Bot to order flowers on the behalf of a user",
        IdleSessionTtlInSeconds = 600,
        Locale = "en-US",
        Name = "OrderFlowers",
        ProcessBehavior = "BUILD",
        VoiceId = "Salli",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := lex.NewBot(ctx, "order_flowers_bot", &lex.BotArgs{
			AbortStatement: &lex.BotAbortStatementArgs{
				Messages: lex.BotAbortStatementMessageArray{
					&lex.BotAbortStatementMessageArgs{
						Content:     pulumi.String("Sorry, I am not able to assist at this time"),
						ContentType: pulumi.String("PlainText"),
					},
				},
			},
			ClarificationPrompt: &lex.BotClarificationPromptArgs{
				Messages: lex.BotClarificationPromptMessageArray{
					&lex.BotClarificationPromptMessageArgs{
						Content:     pulumi.String("I didn't understand you, what would you like to do?"),
						ContentType: pulumi.String("PlainText"),
					},
				},
				MaxAttempts: pulumi.Int(2),
			},
			Intents: lex.BotIntentArray{
				&lex.BotIntentArgs{
					IntentName:    pulumi.String("OrderFlowers"),
					IntentVersion: pulumi.String("1"),
				},
			},
			ChildDirected:           pulumi.Bool(false),
			CreateVersion:           pulumi.Bool(false),
			Description:             pulumi.String("Bot to order flowers on the behalf of a user"),
			IdleSessionTtlInSeconds: pulumi.Int(600),
			Locale:                  pulumi.String("en-US"),
			Name:                    pulumi.String("OrderFlowers"),
			ProcessBehavior:         pulumi.String("BUILD"),
			VoiceId:                 pulumi.String("Salli"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_lex_bot" "order_flowers_bot" {
  abort_statement = {
    messages = [{
      "content"     = "Sorry, I am not able to assist at this time"
      "contentType" = "PlainText"
    }]
  }
  clarification_prompt = {
    messages = [{
      "content"     = "I didn't understand you, what would you like to do?"
      "contentType" = "PlainText"
    }]
    max_attempts = 2
  }
  intents {
    intent_name    = "OrderFlowers"
    intent_version = "1"
  }
  child_directed              = false
  create_version              = false
  description                 = "Bot to order flowers on the behalf of a user"
  idle_session_ttl_in_seconds = 600
  locale                      = "en-US"
  name                        = "OrderFlowers"
  process_behavior            = "BUILD"
  voice_id                    = "Salli"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lex.Bot;
import com.pulumi.aws.lex.BotArgs;
import com.pulumi.aws.lex.inputs.BotAbortStatementArgs;
import com.pulumi.aws.lex.inputs.BotAbortStatementMessageArgs;
import com.pulumi.aws.lex.inputs.BotClarificationPromptArgs;
import com.pulumi.aws.lex.inputs.BotClarificationPromptMessageArgs;
import com.pulumi.aws.lex.inputs.BotIntentArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var orderFlowersBot = new Bot("orderFlowersBot", BotArgs.builder()
            .abortStatement(BotAbortStatementArgs.builder()
                .messages(BotAbortStatementMessageArgs.builder()
                    .content("Sorry, I am not able to assist at this time")
                    .contentType("PlainText")
                    .build())
                .build())
            .clarificationPrompt(BotClarificationPromptArgs.builder()
                .messages(BotClarificationPromptMessageArgs.builder()
                    .content("I didn't understand you, what would you like to do?")
                    .contentType("PlainText")
                    .build())
                .maxAttempts(2)
                .build())
            .intents(BotIntentArgs.builder()
                .intentName("OrderFlowers")
                .intentVersion("1")
                .build())
            .childDirected(false)
            .createVersion(false)
            .description("Bot to order flowers on the behalf of a user")
            .idleSessionTtlInSeconds(600)
            .locale("en-US")
            .name("OrderFlowers")
            .processBehavior("BUILD")
            .voiceId("Salli")
            .build());

    }
}
resources:
  orderFlowersBot:
    type: aws:lex:Bot
    name: order_flowers_bot
    properties:
      abortStatement:
        messages:
          - content: Sorry, I am not able to assist at this time
            contentType: PlainText
      clarificationPrompt:
        messages:
          - content: I didn't understand you, what would you like to do?
            contentType: PlainText
        maxAttempts: 2
      intents:
        - intentName: OrderFlowers
          intentVersion: '1'
      childDirected: false
      createVersion: false
      description: Bot to order flowers on the behalf of a user
      idleSessionTtlInSeconds: 600
      locale: en-US
      name: OrderFlowers
      processBehavior: BUILD
      voiceId: Salli

Import

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

$ pulumi import aws:lex/bot:Bot order_flowers_bot OrderFlowers

Constructors

Bot(String name, {BotArgs? args, CustomResourceOptions? options})
Creates a new Bot. name The Pulumi resource name. args Arguments used to configure this Bot. The set of arguments for Bot. options Resource options controlling this resource's behavior.
Bot.reference(String urn)
Creates a typed reference to an existing Bot resource.

Properties

abortStatement ↔ Output<BotAbortStatement>
The message that Amazon Lex uses to abort a conversation. Attributes are documented under statement.
latefinal
arn ↔ Output<String>
latefinal
checksum ↔ Output<String>
Checksum identifying the version of the bot that was created. The checksum is not included as an argument because the resource will add it automatically when updating the bot.
latefinal
childDirected ↔ Output<bool>
By specifying true, you confirm that your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. For more information see the Amazon Lex FAQ and the Amazon Lex PutBot API Docs.
latefinal
childResources → Set<Resource>
finalinherited
clarificationPrompt ↔ Output<BotClarificationPrompt?>
The message that Amazon Lex uses when it doesn't understand the user's request. Attributes are documented under prompt.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createdDate ↔ Output<String>
The date when the bot version was created.
latefinal
createVersion ↔ Output<bool?>
Determines if a new bot version is created when the initial resource is created and on each update. Defaults to false.
latefinal
description ↔ Output<String?>
A description of the bot. Must be less than or equal to 200 characters in length.
latefinal
detectSentiment ↔ Output<bool?>
When set to true user utterances are sent to Amazon Comprehend for sentiment analysis. If you don't specify detectSentiment, the default is false.
latefinal
enableModelImprovements ↔ Output<bool?>
Set to true to enable access to natural language understanding improvements. When you set the enableModelImprovements parameter to true you can use the nluIntentConfidenceThreshold parameter to configure confidence scores. For more information, see Confidence Scores. You can only set the enableModelImprovements parameter in certain Regions. If you set the parameter to true, your bot has access to accuracy improvements. For more information see the Amazon Lex Bot PutBot API Docs.
latefinal
failureReason ↔ Output<String>
If status is FAILED, Amazon Lex provides the reason that it failed to build the bot.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
idleSessionTtlInSeconds ↔ Output<int?>
The maximum time in seconds that Amazon Lex retains the data gathered in a conversation. Default is 300. Must be a number between 60 and 86400 (inclusive).
latefinal
intents ↔ Output<List<BotIntent>>
A set of Intent objects. Each intent represents a command that a user can express. Attributes are documented under intent. Can have up to 250 Intent objects.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
lastUpdatedDate ↔ Output<String>
The date when the $LATEST version of this bot was updated.
latefinal
locale ↔ Output<String?>
Specifies the target locale for the bot. Any intent used in the bot must be compatible with the locale of the bot. For available locales, see Amazon Lex Bot PutBot API Docs. Default is en-US.
latefinal
name ↔ Output<String>
The name of the bot that you want to create, case sensitive. Must be between 2 and 50 characters in length.
latefinal
nluIntentConfidenceThreshold ↔ Output<double?>
Determines the threshold where Amazon Lex will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents in a PostContent or PostText response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot. For more information see Amazon Lex Bot PutBot API Docs This value requires enableModelImprovements to be set to true and the default is 0. Must be a float between 0 and 1.
latefinal
processBehavior ↔ Output<String?>
If you set the processBehavior element to BUILD, Amazon Lex builds the bot so that it can be run. If you set the element to SAVE Amazon Lex saves the bot, but doesn't build it. Default is SAVE.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status ↔ Output<String>
When you send a request to create or update a bot, Amazon Lex sets the status response element to BUILDING. After Amazon Lex builds the bot, it sets status to READY. If Amazon Lex can't build the bot, it sets status to FAILED. Amazon Lex returns the reason for the failure in the failureReason response element.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
version ↔ Output<String>
The version of the bot.
latefinal
voiceId ↔ Output<String>
The Amazon Polly voice ID that you want Amazon Lex to use for voice interactions with the user. The locale configured for the voice must match the locale of the bot. For more information, see Available Voices in the Amazon Polly Developer Guide.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {BotState? state, CustomResourceOptions? options}) → Bot
Gets an existing Bot resource's state with the given name and id.