Skip to main content

bots

Creates, updates, deletes or gets a bot resource or lists bots in a region

Overview

Namebots
TypeResource
DescriptionAmazon Lex conversational bot performing automated tasks such as ordering a pizza, booking a hotel, and so on.
Idawscc.lex.bots

Fields

NameDatatypeDescription
idstringUnique ID of resource
arnstring
namestringA unique identifier for a resource.
descriptionstringA description of the version. Use the description to help identify the version in lists.
role_arnstring
data_privacyobject
error_log_settingsobject
idle_session_ttl_in_secondsinteger
bot_localesarray
bot_file_s3_locationobject
bot_tagsarray
test_bot_alias_tagsarray
auto_build_bot_localesboolean
test_bot_alias_settingsobject
replicationobject
regionstringAWS region.

For more information, see AWS::Lex::Bot.

Methods

NameResourceAccessible byRequired Params
create_resourcebotsINSERTName, RoleArn, DataPrivacy, IdleSessionTTLInSeconds, region
delete_resourcebotsDELETEIdentifier, region
update_resourcebotsUPDATEIdentifier, PatchDocument, region
list_resourcesbots_list_onlySELECTregion
get_resourcebotsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual bot.

SELECT
region,
id,
arn,
name,
description,
role_arn,
data_privacy,
error_log_settings,
idle_session_ttl_in_seconds,
bot_locales,
bot_file_s3_location,
bot_tags,
test_bot_alias_tags,
auto_build_bot_locales,
test_bot_alias_settings,
replication
FROM awscc.lex.bots
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new bot resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.lex.bots (
Name,
RoleArn,
DataPrivacy,
IdleSessionTTLInSeconds,
region
)
SELECT
'{{ name }}',
'{{ role_arn }}',
'{{ data_privacy }}',
'{{ idle_session_ttl_in_seconds }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a bot resource, using stack-deploy.

/*+ update */
UPDATE awscc.lex.bots
SET PatchDocument = string('{{ {
"Name": name,
"Description": description,
"RoleArn": role_arn,
"DataPrivacy": data_privacy,
"ErrorLogSettings": error_log_settings,
"IdleSessionTTLInSeconds": idle_session_ttl_in_seconds,
"BotLocales": bot_locales,
"BotFileS3Location": bot_file_s3_location,
"BotTags": bot_tags,
"TestBotAliasTags": test_bot_alias_tags,
"AutoBuildBotLocales": auto_build_bot_locales,
"TestBotAliasSettings": test_bot_alias_settings,
"Replication": replication
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.lex.bots
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the bots resource, the following permissions are required:

iam:PassRole,
lex:DescribeBot,
lex:CreateUploadUrl,
lex:StartImport,
lex:DescribeImport,
lex:ListTagsForResource,
lex:TagResource,
lex:CreateBot,
lex:CreateBotLocale,
lex:CreateIntent,
lex:CreateSlot,
lex:CreateSlotType,
lex:UpdateBot,
lex:UpdateBotLocale,
lex:UpdateIntent,
lex:UpdateSlot,
lex:UpdateSlotType,
lex:DeleteBotLocale,
lex:DeleteIntent,
lex:DeleteSlot,
lex:DeleteSlotType,
lex:DescribeBotLocale,
lex:BuildBotLocale,
lex:ListBots,
lex:ListBotLocales,
lex:CreateCustomVocabulary,
lex:UpdateCustomVocabulary,
lex:DeleteCustomVocabulary,
s3:GetObject,
lex:UpdateBotAlias,
iam:CreateServiceLinkedRole,
iam:GetRole,
lex:CreateBotReplica,
lex:DescribeBotReplica,
lex:DeleteBotReplica