prompts
Creates, updates, deletes or gets a prompt resource or lists prompts in a region
Overview
| Name | prompts |
| Type | Resource |
| Description | Definition of AWS::Bedrock::Prompt Resource Type |
| Id | awscc.bedrock.prompts |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | ARN of a prompt resource possibly with a version |
created_at | string | Time Stamp. |
default_variant | string | Name for a variant. |
description | string | Name for a prompt resource. |
id | string | Identifier for a Prompt |
name | string | Name for a prompt resource. |
updated_at | string | Time Stamp. |
variants | array | List of prompt variants |
tags | object | A map of tag keys and values |
customer_encryption_key_arn | string | A KMS key ARN |
version | string | Draft Version. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | ARN of a prompt resource possibly with a version |
region | string | AWS region. |
For more information, see AWS::Bedrock::Prompt.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | prompts | INSERT | Name, region |
delete_resource | prompts | DELETE | Identifier, region |
update_resource | prompts | UPDATE | Identifier, PatchDocument, region |
list_resources | prompts_list_only | SELECT | region |
get_resource | prompts | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual prompt.
SELECT
region,
arn,
created_at,
default_variant,
description,
id,
name,
updated_at,
variants,
tags,
customer_encryption_key_arn,
version
FROM awscc.bedrock.prompts
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all prompts in a region.
SELECT
region,
arn
FROM awscc.bedrock.prompts_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new prompt resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.bedrock.prompts (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.bedrock.prompts (
DefaultVariant,
Description,
Name,
Variants,
Tags,
CustomerEncryptionKeyArn,
region
)
SELECT
'{{ default_variant }}',
'{{ description }}',
'{{ name }}',
'{{ variants }}',
'{{ tags }}',
'{{ customer_encryption_key_arn }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: prompt
props:
- name: default_variant
value: '{{ default_variant }}'
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: variants
value:
- name: '{{ name }}'
template_type: '{{ template_type }}'
template_configuration: null
model_id: '{{ model_id }}'
inference_configuration: null
gen_ai_resource: null
additional_model_request_fields: {}
metadata:
- key: '{{ key }}'
value: '{{ value }}'
- name: tags
value: {}
- name: customer_encryption_key_arn
value: '{{ customer_encryption_key_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a prompt resource, using stack-deploy.
/*+ update */
UPDATE awscc.bedrock.prompts
SET PatchDocument = string('{{ {
"DefaultVariant": default_variant,
"Description": description,
"Name": name,
"Variants": variants,
"Tags": tags,
"CustomerEncryptionKeyArn": customer_encryption_key_arn
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.bedrock.prompts
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the prompts resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
bedrock:CreatePrompt,
bedrock:GetPrompt,
s3:GetObject,
s3:GetObjectVersion,
bedrock:TagResource,
bedrock:ListTagsForResource,
kms:GenerateDataKey,
kms:Decrypt
bedrock:GetPrompt,
bedrock:ListTagsForResource,
kms:Decrypt
bedrock:UpdatePrompt,
bedrock:GetPrompt,
s3:GetObject,
s3:GetObjectVersion,
bedrock:TagResource,
bedrock:UntagResource,
bedrock:ListTagsForResource,
kms:GenerateDataKey,
kms:Decrypt
bedrock:DeletePrompt,
bedrock:GetPrompt
bedrock:ListPrompts