CreateBotAlias - Amazon Lex

CreateBotAlias

Creates an alias for the specified version of a bot. Use an alias to enable you to change the version of a bot without updating applications that use the bot.

For example, you can create an alias called "PROD" that your applications use to call the Amazon Lex bot.

Request Syntax

PUT /bots/botId/botaliases/ HTTP/1.1 Content-type: application/json { "botAliasLocaleSettings": { "string" : { "codeHookSpecification": { "lambdaCodeHook": { "codeHookInterfaceVersion": "string", "lambdaARN": "string" } }, "enabled": boolean } }, "botAliasName": "string", "botVersion": "string", "conversationLogSettings": { "audioLogSettings": [ { "destination": { "s3Bucket": { "kmsKeyArn": "string", "logPrefix": "string", "s3BucketArn": "string" } }, "enabled": boolean } ], "textLogSettings": [ { "destination": { "cloudWatch": { "cloudWatchLogGroupArn": "string", "logPrefix": "string" } }, "enabled": boolean } ] }, "description": "string", "sentimentAnalysisSettings": { "detectSentiment": boolean }, "tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

botId

The unique identifier of the bot that the alias applies to.

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

Required: Yes

Request Body

The request accepts the following data in JSON format.

botAliasLocaleSettings

Maps configuration information to a specific locale. You can use this parameter to specify a specific Lambda function to run different functions in different locales.

Type: String to BotAliasLocaleSettings object map

Map Entries: Maximum number of items.

Required: No

botAliasName

The alias to create. The name must be unique for the bot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^([0-9a-zA-Z][_-]?)+$

Required: Yes

botVersion

The version of the bot that this alias points to. You can use the UpdateBotAlias operation to change the bot version associated with the alias.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^[0-9]+$

Required: No

conversationLogSettings

Specifies whether Amazon Lex logs text and audio for a conversation with the bot. When you enable conversation logs, text logs store text input, transcripts of audio input, and associated metadata in Amazon CloudWatch Logs. Audio logs store audio input in Amazon S3.

Type: ConversationLogSettings object

Required: No

description

A description of the alias. Use this description to help identify the alias.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 200.

Required: No

sentimentAnalysisSettings

Determines whether Amazon Lex will use Amazon Comprehend to detect the sentiment of user utterances.

Type: SentimentAnalysisSettings object

Required: No

tags

A list of tags to add to the bot alias. You can only add tags when you create an alias, you can't use the UpdateBotAlias operation to update the tags on a bot alias. To update tags, use the TagResource operation.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Required: No

Response Syntax

HTTP/1.1 202 Content-type: application/json { "botAliasId": "string", "botAliasLocaleSettings": { "string" : { "codeHookSpecification": { "lambdaCodeHook": { "codeHookInterfaceVersion": "string", "lambdaARN": "string" } }, "enabled": boolean } }, "botAliasName": "string", "botAliasStatus": "string", "botId": "string", "botVersion": "string", "conversationLogSettings": { "audioLogSettings": [ { "destination": { "s3Bucket": { "kmsKeyArn": "string", "logPrefix": "string", "s3BucketArn": "string" } }, "enabled": boolean } ], "textLogSettings": [ { "destination": { "cloudWatch": { "cloudWatchLogGroupArn": "string", "logPrefix": "string" } }, "enabled": boolean } ] }, "creationDateTime": number, "description": "string", "sentimentAnalysisSettings": { "detectSentiment": boolean }, "tags": { "string" : "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 202 response.

The following data is returned in JSON format by the service.

botAliasId

The unique identifier of the bot alias.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^(\bTSTALIASID\b|[0-9a-zA-Z]+)$

botAliasLocaleSettings

Configuration information for a specific locale.

Type: String to BotAliasLocaleSettings object map

Map Entries: Maximum number of items.

botAliasName

The name specified for the bot alias.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^([0-9a-zA-Z][_-]?)+$

botAliasStatus

The current status of the alias. The alias is first put into the Creating state. When the alias is ready to be used, it is put into the Available state. You can use the DescribeBotAlias operation to get the current state of an alias.

Type: String

Valid Values: Creating | Available | Deleting | Failed

botId

The unique identifier of the bot that this alias applies to.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

botVersion

The version of the bot associated with this alias.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^[0-9]+$

conversationLogSettings

The conversation log settings specified for the alias.

Type: ConversationLogSettings object

creationDateTime

A Unix timestamp indicating the date and time that the bot alias was created.

Type: Timestamp

description

The description specified for the bot alias.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 200.

sentimentAnalysisSettings

Determines whether Amazon Lex will use Amazon Comprehend to detect the sentiment of user utterances.

Type: SentimentAnalysisSettings object

tags

A list of tags associated with the bot alias.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 200 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

HTTP Status Code: 409

InternalServerException

HTTP Status Code: 500

PreconditionFailedException

HTTP Status Code: 412

ServiceQuotaExceededException

HTTP Status Code: 402

ThrottlingException

HTTP Status Code: 429

ValidationException

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: