message_templates
Creates, updates, deletes or gets a message_template resource or lists message_templates in a region
Overview
| Name | message_templates |
| Type | Resource |
| Description | Definition of AWS::Wisdom::MessageTemplate Resource Type |
| Id | awscc.wisdom.message_templates |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
knowledge_base_arn | string | The Amazon Resource Name (ARN) of the knowledge base to which the message template belongs. |
message_template_id | string | The unique identifier of the message template. |
message_template_arn | string | The Amazon Resource Name (ARN) of the message template. |
name | string | The name of the message template. |
channel_subtype | string | The channel subtype this message template applies to. |
content | object | The content of the message template. |
description | string | The description of the message template. |
language | string | The language code value for the language in which the message template is written. The supported language codes include de_DE, en_US, es_ES, fr_FR, id_ID, it_IT, ja_JP, ko_KR, pt_BR, zh_CN, zh_TW |
grouping_configuration | object | The configuration information of the user groups that the quick response is accessible to. |
default_attributes | object | An object that specifies the default values to use for variables in the message template. This object contains different categories of key-value pairs. Each key defines a variable or placeholder in the message template. The corresponding value defines the default value for that variable. |
message_template_content_sha256 | string | The content SHA256 of the message template. |
message_template_attachments | array | List of message template attachments |
tags | array | The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
message_template_arn | string | The Amazon Resource Name (ARN) of the message template. |
region | string | AWS region. |
For more information, see AWS::Wisdom::MessageTemplate.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | message_templates | INSERT | KnowledgeBaseArn, ChannelSubtype, Name, Content, region |
delete_resource | message_templates | DELETE | Identifier, region |
update_resource | message_templates | UPDATE | Identifier, PatchDocument, region |
list_resources | message_templates_list_only | SELECT | region |
get_resource | message_templates | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual message_template.
SELECT
region,
knowledge_base_arn,
message_template_id,
message_template_arn,
name,
channel_subtype,
content,
description,
language,
grouping_configuration,
default_attributes,
message_template_content_sha256,
message_template_attachments,
tags
FROM awscc.wisdom.message_templates
WHERE
region = '{{ region }}' AND
Identifier = '{{ message_template_arn }}';
Lists all message_templates in a region.
SELECT
region,
message_template_arn
FROM awscc.wisdom.message_templates_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new message_template resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.wisdom.message_templates (
KnowledgeBaseArn,
Name,
ChannelSubtype,
Content,
region
)
SELECT
'{{ knowledge_base_arn }}',
'{{ name }}',
'{{ channel_subtype }}',
'{{ content }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.wisdom.message_templates (
KnowledgeBaseArn,
Name,
ChannelSubtype,
Content,
Description,
Language,
GroupingConfiguration,
DefaultAttributes,
MessageTemplateAttachments,
Tags,
region
)
SELECT
'{{ knowledge_base_arn }}',
'{{ name }}',
'{{ channel_subtype }}',
'{{ content }}',
'{{ description }}',
'{{ language }}',
'{{ grouping_configuration }}',
'{{ default_attributes }}',
'{{ message_template_attachments }}',
'{{ 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: message_template
props:
- name: knowledge_base_arn
value: '{{ knowledge_base_arn }}'
- name: name
value: '{{ name }}'
- name: channel_subtype
value: '{{ channel_subtype }}'
- name: content
value:
email_message_template_content:
subject: '{{ subject }}'
body:
plain_text:
content: '{{ content }}'
html: null
headers:
- name: '{{ name }}'
value: '{{ value }}'
sms_message_template_content:
body:
plain_text: null
- name: description
value: '{{ description }}'
- name: language
value: '{{ language }}'
- name: grouping_configuration
value:
criteria: '{{ criteria }}'
values:
- '{{ values[0] }}'
- name: default_attributes
value:
system_attributes:
name: '{{ name }}'
customer_endpoint:
address: '{{ address }}'
system_endpoint: null
agent_attributes:
first_name: '{{ first_name }}'
last_name: '{{ last_name }}'
customer_profile_attributes:
profile_id: '{{ profile_id }}'
profile_arn: '{{ profile_arn }}'
first_name: '{{ first_name }}'
middle_name: '{{ middle_name }}'
last_name: '{{ last_name }}'
account_number: '{{ account_number }}'
email_address: '{{ email_address }}'
phone_number: '{{ phone_number }}'
additional_information: '{{ additional_information }}'
party_type: '{{ party_type }}'
business_name: '{{ business_name }}'
birth_date: '{{ birth_date }}'
gender: '{{ gender }}'
mobile_phone_number: '{{ mobile_phone_number }}'
home_phone_number: '{{ home_phone_number }}'
business_phone_number: '{{ business_phone_number }}'
business_email_address: '{{ business_email_address }}'
address1: '{{ address1 }}'
address2: '{{ address2 }}'
address3: '{{ address3 }}'
address4: '{{ address4 }}'
city: '{{ city }}'
county: '{{ county }}'
country: '{{ country }}'
postal_code: '{{ postal_code }}'
province: '{{ province }}'
state: '{{ state }}'
shipping_address1: '{{ shipping_address1 }}'
shipping_address2: '{{ shipping_address2 }}'
shipping_address3: '{{ shipping_address3 }}'
shipping_address4: '{{ shipping_address4 }}'
shipping_city: '{{ shipping_city }}'
shipping_county: '{{ shipping_county }}'
shipping_country: '{{ shipping_country }}'
shipping_postal_code: '{{ shipping_postal_code }}'
shipping_province: '{{ shipping_province }}'
shipping_state: '{{ shipping_state }}'
mailing_address1: '{{ mailing_address1 }}'
mailing_address2: '{{ mailing_address2 }}'
mailing_address3: '{{ mailing_address3 }}'
mailing_address4: '{{ mailing_address4 }}'
mailing_city: '{{ mailing_city }}'
mailing_county: '{{ mailing_county }}'
mailing_country: '{{ mailing_country }}'
mailing_postal_code: '{{ mailing_postal_code }}'
mailing_province: '{{ mailing_province }}'
mailing_state: '{{ mailing_state }}'
billing_address1: '{{ billing_address1 }}'
billing_address2: '{{ billing_address2 }}'
billing_address3: '{{ billing_address3 }}'
billing_address4: '{{ billing_address4 }}'
billing_city: '{{ billing_city }}'
billing_county: '{{ billing_county }}'
billing_country: '{{ billing_country }}'
billing_postal_code: '{{ billing_postal_code }}'
billing_province: '{{ billing_province }}'
billing_state: '{{ billing_state }}'
custom: {}
custom_attributes: null
- name: message_template_attachments
value:
- attachment_id: '{{ attachment_id }}'
attachment_name: '{{ attachment_name }}'
s3_presigned_url: '{{ s3_presigned_url }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a message_template resource, using stack-deploy.
/*+ update */
UPDATE awscc.wisdom.message_templates
SET PatchDocument = string('{{ {
"Name": name,
"Content": content,
"Description": description,
"Language": language,
"GroupingConfiguration": grouping_configuration,
"DefaultAttributes": default_attributes,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ message_template_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.wisdom.message_templates
WHERE
Identifier = '{{ message_template_arn }}' 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 message_templates resource, the following permissions are required:
- Create
- Update
- Delete
- List
- Read
wisdom:CreateMessageTemplate,
wisdom:GetMessageTemplate,
wisdom:TagResource,
connect:SearchRoutingProfiles,
connect:DescribeRoutingProfile,
wisdom:CreateMessageTemplateAttachment,
wisdom:DeleteMessageTemplateAttachment
wisdom:UpdateMessageTemplate,
wisdom:UpdateMessageTemplateMetadata,
wisdom:GetMessageTemplate,
wisdom:TagResource,
wisdom:UntagResource,
connect:SearchRoutingProfiles,
connect:DescribeRoutingProfile,
wisdom:CreateMessageTemplateAttachment,
wisdom:DeleteMessageTemplateAttachment
wisdom:DeleteMessageTemplate,
wisdom:UntagResource,
wisdom:DeleteMessageTemplateAttachment
wisdom:ListMessageTemplates
wisdom:GetMessageTemplate