bot_aliases
Creates, updates, deletes or gets a bot_alias resource or lists bot_aliases in a region
Overview
| Name | bot_aliases |
| Type | Resource |
| Description | A Bot Alias enables you to change the version of a bot without updating applications that use the bot |
| Id | awscc.lex.bot_aliases |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
bot_alias_id | string | Unique ID of resource |
arn | string | |
bot_alias_status | string | |
bot_alias_locale_settings | array | A list of bot alias locale settings to add to the bot alias. |
bot_alias_name | string | A unique identifier for a resource. |
bot_version | object | A version is a numbered snapshot of your work that you can publish for use in different parts of your workflow, such as development, beta deployment, and production. |
conversation_log_settings | object | Contains information about code hooks that Amazon Lex calls during a conversation. |
description | string | A description of the version. Use the description to help identify the version in lists. |
sentiment_analysis_settings | object | Determines whether Amazon Lex will use Amazon Comprehend to detect the sentiment of user utterances. |
bot_alias_tags | array | A list of tags to add to the bot alias. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
bot_alias_id | string | Unique ID of resource |
region | string | AWS region. |
For more information, see AWS::Lex::BotAlias.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | bot_aliases | INSERT | BotId, BotAliasName, region |
delete_resource | bot_aliases | DELETE | Identifier, region |
update_resource | bot_aliases | UPDATE | Identifier, PatchDocument, region |
list_resources | bot_aliases_list_only | SELECT | region |
get_resource | bot_aliases | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual bot_alias.
SELECT
region,
bot_alias_id,
bot_id,
arn,
bot_alias_status,
bot_alias_locale_settings,
bot_alias_name,
bot_version,
conversation_log_settings,
description,
sentiment_analysis_settings,
bot_alias_tags
FROM awscc.lex.bot_aliases
WHERE
region = '{{ region }}' AND
Identifier = '{{ bot_alias_id }}|{{ bot_id }}';
Lists all bot_aliases in a region.
SELECT
region,
bot_alias_id,
bot_id
FROM awscc.lex.bot_aliases_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new bot_alias resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lex.bot_aliases (
BotId,
BotAliasName,
region
)
SELECT
'{{ bot_id }}',
'{{ bot_alias_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lex.bot_aliases (
BotId,
BotAliasLocaleSettings,
BotAliasName,
BotVersion,
ConversationLogSettings,
Description,
SentimentAnalysisSettings,
BotAliasTags,
region
)
SELECT
'{{ bot_id }}',
'{{ bot_alias_locale_settings }}',
'{{ bot_alias_name }}',
'{{ bot_version }}',
'{{ conversation_log_settings }}',
'{{ description }}',
'{{ sentiment_analysis_settings }}',
'{{ bot_alias_tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: bot_alias
props:
- name: bot_id
value: '{{ bot_id }}'
- name: bot_alias_locale_settings
value:
- locale_id: '{{ locale_id }}'
bot_alias_locale_setting:
code_hook_specification:
lambda_code_hook:
code_hook_interface_version: '{{ code_hook_interface_version }}'
lambda_arn: '{{ lambda_arn }}'
enabled: '{{ enabled }}'
- name: bot_alias_name
value: '{{ bot_alias_name }}'
- name: bot_version
value:
bot_id: null
description: '{{ description }}'
bot_version_locale_specification:
- locale_id: '{{ locale_id }}'
bot_version_locale_details:
source_bot_version: null
- name: conversation_log_settings
value:
audio_log_settings:
- destination:
s3_bucket:
s3_bucket_arn: '{{ s3_bucket_arn }}'
log_prefix: '{{ log_prefix }}'
kms_key_arn: '{{ kms_key_arn }}'
enabled: '{{ enabled }}'
text_log_settings:
- destination:
cloud_watch:
cloud_watch_log_group_arn: '{{ cloud_watch_log_group_arn }}'
log_prefix: '{{ log_prefix }}'
enabled: '{{ enabled }}'
- name: description
value: null
- name: sentiment_analysis_settings
value:
detect_sentiment: '{{ detect_sentiment }}'
- name: bot_alias_tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a bot_alias resource, using stack-deploy.
/*+ update */
UPDATE awscc.lex.bot_aliases
SET PatchDocument = string('{{ {
"BotAliasLocaleSettings": bot_alias_locale_settings,
"BotAliasName": bot_alias_name,
"BotVersion": bot_version,
"ConversationLogSettings": conversation_log_settings,
"Description": description,
"SentimentAnalysisSettings": sentiment_analysis_settings,
"BotAliasTags": bot_alias_tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ bot_alias_id }}|{{ bot_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.lex.bot_aliases
WHERE
Identifier = '{{ bot_alias_id }}|{{ bot_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:
| Parameter | Description |
|---|---|
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 bot_aliases resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
lex:CreateBotAlias,
lex:DescribeBot
lex:UpdateBotAlias,
lex:DescribeBotAlias,
lex:ListTagsForResource,
lex:TagResource,
lex:UntagResource
lex:DescribeBotAlias
lex:DeleteBotAlias
lex:ListBotAliases