ai_prompts
Creates, updates, deletes or gets an ai_prompt resource or lists ai_prompts in a region
Overview
| Name | ai_prompts |
| Type | Resource |
| Description | Definition of AWS::Wisdom::AIPrompt Resource Type |
| Id | awscc.wisdom.ai_prompts |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
a_iprompt_id | string | |
a_iprompt_arn | string | |
api_format | string | |
assistant_id | string | |
assistant_arn | string | |
description | string | |
model_id | string | |
name | string | |
tags | object | |
template_configuration | object | |
template_type | string | |
type | string | |
modified_time_seconds | number | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
a_iprompt_id | string | |
assistant_id | string | |
region | string | AWS region. |
For more information, see AWS::Wisdom::AIPrompt.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ai_prompts | INSERT | ApiFormat, ModelId, TemplateConfiguration, TemplateType, Type, region |
delete_resource | ai_prompts | DELETE | Identifier, region |
update_resource | ai_prompts | UPDATE | Identifier, PatchDocument, region |
list_resources | ai_prompts_list_only | SELECT | region |
get_resource | ai_prompts | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual ai_prompt.
SELECT
region,
a_iprompt_id,
a_iprompt_arn,
api_format,
assistant_id,
assistant_arn,
description,
model_id,
name,
tags,
template_configuration,
template_type,
type,
modified_time_seconds
FROM awscc.wisdom.ai_prompts
WHERE
region = '{{ region }}' AND
Identifier = '{{ a_iprompt_id }}|{{ assistant_id }}';
Lists all ai_prompts in a region.
SELECT
region,
a_iprompt_id,
assistant_id
FROM awscc.wisdom.ai_prompts_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new ai_prompt resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.wisdom.ai_prompts (
ApiFormat,
ModelId,
TemplateConfiguration,
TemplateType,
Type,
region
)
SELECT
'{{ api_format }}',
'{{ model_id }}',
'{{ template_configuration }}',
'{{ template_type }}',
'{{ type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.wisdom.ai_prompts (
ApiFormat,
AssistantId,
Description,
ModelId,
Name,
Tags,
TemplateConfiguration,
TemplateType,
Type,
region
)
SELECT
'{{ api_format }}',
'{{ assistant_id }}',
'{{ description }}',
'{{ model_id }}',
'{{ name }}',
'{{ tags }}',
'{{ template_configuration }}',
'{{ template_type }}',
'{{ type }}',
'{{ 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: ai_prompt
props:
- name: api_format
value: '{{ api_format }}'
- name: assistant_id
value: '{{ assistant_id }}'
- name: description
value: '{{ description }}'
- name: model_id
value: '{{ model_id }}'
- name: name
value: '{{ name }}'
- name: tags
value: {}
- name: template_configuration
value: {}
- name: template_type
value: '{{ template_type }}'
- name: type
value: '{{ type }}'
UPDATE example
Use the following StackQL query and manifest file to update a ai_prompt resource, using stack-deploy.
/*+ update */
UPDATE awscc.wisdom.ai_prompts
SET PatchDocument = string('{{ {
"Description": description,
"ModelId": model_id,
"TemplateConfiguration": template_configuration
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ a_iprompt_id }}|{{ assistant_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.wisdom.ai_prompts
WHERE
Identifier = '{{ a_iprompt_id }}|{{ assistant_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 ai_prompts resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
wisdom:CreateAIPrompt,
wisdom:TagResource
wisdom:GetAIPrompt
wisdom:UpdateAIPrompt
wisdom:DeleteAIPrompt
wisdom:ListAIPrompts