agents
Creates, updates, deletes or gets an agent resource or lists agents in a region
Overview
| Name | agents |
| Type | Resource |
| Description | Definition of AWS::Bedrock::Agent Resource Type |
| Id | awscc.bedrock.agents |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
action_groups | array | List of ActionGroups |
agent_arn | string | Arn representation of the Agent. |
agent_id | string | Identifier for a resource. |
agent_name | string | Name for a resource. |
agent_resource_role_arn | string | ARN of a IAM role. |
agent_status | string | Schema Type for Action APIs. |
agent_version | string | Draft Agent Version. |
auto_prepare | boolean | Specifies whether to automatically prepare after creating or updating the agent. |
created_at | string | Time Stamp. |
custom_orchestration | object | Structure for custom orchestration |
customer_encryption_key_arn | string | A KMS key ARN |
skip_resource_in_use_check_on_delete | boolean | Specifies whether to allow deleting agent while it is in use. |
description | string | Description of the Resource. |
failure_reasons | array | Failure Reasons for Error. |
foundation_model | string | ARN or name of a Bedrock model. |
guardrail_configuration | object | Configuration for a guardrail |
memory_configuration | object | Configuration for memory storage |
idle_session_ttl_in_seconds | number | Max Session Time. |
agent_collaboration | string | Agent collaboration state |
instruction | string | Instruction for the agent. |
knowledge_bases | array | List of Agent Knowledge Bases |
agent_collaborators | array | List of Agent Collaborators |
orchestration_type | string | Types of orchestration strategy for agents |
prepared_at | string | Time Stamp. |
prompt_override_configuration | object | Configuration for prompt override. |
recommended_actions | array | The recommended actions users can take to resolve an error in failureReasons. |
tags | object | A map of tag keys and values |
updated_at | string | Time Stamp. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
agent_id | string | Identifier for a resource. |
region | string | AWS region. |
For more information, see AWS::Bedrock::Agent.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | agents | INSERT | AgentName, region |
delete_resource | agents | DELETE | Identifier, region |
update_resource | agents | UPDATE | Identifier, PatchDocument, region |
list_resources | agents_list_only | SELECT | region |
get_resource | agents | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual agent.
SELECT
region,
action_groups,
agent_arn,
agent_id,
agent_name,
agent_resource_role_arn,
agent_status,
agent_version,
auto_prepare,
created_at,
custom_orchestration,
customer_encryption_key_arn,
skip_resource_in_use_check_on_delete,
description,
failure_reasons,
foundation_model,
guardrail_configuration,
memory_configuration,
idle_session_ttl_in_seconds,
agent_collaboration,
instruction,
knowledge_bases,
agent_collaborators,
orchestration_type,
prepared_at,
prompt_override_configuration,
recommended_actions,
tags,
test_alias_tags,
updated_at
FROM awscc.bedrock.agents
WHERE
region = '{{ region }}' AND
Identifier = '{{ agent_id }}';
Lists all agents in a region.
SELECT
region,
agent_id
FROM awscc.bedrock.agents_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new agent resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.bedrock.agents (
AgentName,
region
)
SELECT
'{{ agent_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.bedrock.agents (
ActionGroups,
AgentName,
AgentResourceRoleArn,
AutoPrepare,
CustomOrchestration,
CustomerEncryptionKeyArn,
SkipResourceInUseCheckOnDelete,
Description,
FoundationModel,
GuardrailConfiguration,
MemoryConfiguration,
IdleSessionTTLInSeconds,
AgentCollaboration,
Instruction,
KnowledgeBases,
AgentCollaborators,
OrchestrationType,
PromptOverrideConfiguration,
Tags,
TestAliasTags,
region
)
SELECT
'{{ action_groups }}',
'{{ agent_name }}',
'{{ agent_resource_role_arn }}',
'{{ auto_prepare }}',
'{{ custom_orchestration }}',
'{{ customer_encryption_key_arn }}',
'{{ skip_resource_in_use_check_on_delete }}',
'{{ description }}',
'{{ foundation_model }}',
'{{ guardrail_configuration }}',
'{{ memory_configuration }}',
'{{ idle_session_ttl_in_seconds }}',
'{{ agent_collaboration }}',
'{{ instruction }}',
'{{ knowledge_bases }}',
'{{ agent_collaborators }}',
'{{ orchestration_type }}',
'{{ prompt_override_configuration }}',
'{{ tags }}',
'{{ test_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: agent
props:
- name: action_groups
value:
- action_group_name: '{{ action_group_name }}'
description: '{{ description }}'
parent_action_group_signature: '{{ parent_action_group_signature }}'
action_group_executor: null
api_schema: null
action_group_state: '{{ action_group_state }}'
function_schema:
functions:
- name: '{{ name }}'
description: '{{ description }}'
parameters: {}
require_confirmation: '{{ require_confirmation }}'
skip_resource_in_use_check_on_delete: '{{ skip_resource_in_use_check_on_delete }}'
- name: agent_name
value: '{{ agent_name }}'
- name: agent_resource_role_arn
value: '{{ agent_resource_role_arn }}'
- name: auto_prepare
value: '{{ auto_prepare }}'
- name: custom_orchestration
value:
executor:
lambda: '{{ lambda }}'
- name: customer_encryption_key_arn
value: '{{ customer_encryption_key_arn }}'
- name: skip_resource_in_use_check_on_delete
value: '{{ skip_resource_in_use_check_on_delete }}'
- name: description
value: '{{ description }}'
- name: foundation_model
value: '{{ foundation_model }}'
- name: guardrail_configuration
value:
guardrail_identifier: '{{ guardrail_identifier }}'
guardrail_version: '{{ guardrail_version }}'
- name: memory_configuration
value:
enabled_memory_types:
- '{{ enabled_memory_types[0] }}'
storage_days: null
session_summary_configuration:
max_recent_sessions: null
- name: idle_session_ttl_in_seconds
value: null
- name: agent_collaboration
value: '{{ agent_collaboration }}'
- name: instruction
value: '{{ instruction }}'
- name: knowledge_bases
value:
- knowledge_base_id: '{{ knowledge_base_id }}'
description: '{{ description }}'
knowledge_base_state: '{{ knowledge_base_state }}'
- name: agent_collaborators
value:
- agent_descriptor:
alias_arn: '{{ alias_arn }}'
collaboration_instruction: '{{ collaboration_instruction }}'
collaborator_name: '{{ collaborator_name }}'
relay_conversation_history: '{{ relay_conversation_history }}'
- name: orchestration_type
value: '{{ orchestration_type }}'
- name: prompt_override_configuration
value:
prompt_configurations:
- prompt_type: '{{ prompt_type }}'
prompt_creation_mode: '{{ prompt_creation_mode }}'
prompt_state: '{{ prompt_state }}'
base_prompt_template: '{{ base_prompt_template }}'
inference_configuration:
temperature: null
top_p: null
top_k: null
maximum_length: null
stop_sequences:
- '{{ stop_sequences[0] }}'
parser_mode: null
foundation_model: null
additional_model_request_fields: {}
override_lambda: '{{ override_lambda }}'
- name: tags
value: {}
- name: test_alias_tags
value: null
UPDATE example
Use the following StackQL query and manifest file to update a agent resource, using stack-deploy.
/*+ update */
UPDATE awscc.bedrock.agents
SET PatchDocument = string('{{ {
"ActionGroups": action_groups,
"AgentName": agent_name,
"AgentResourceRoleArn": agent_resource_role_arn,
"AutoPrepare": auto_prepare,
"CustomOrchestration": custom_orchestration,
"CustomerEncryptionKeyArn": customer_encryption_key_arn,
"SkipResourceInUseCheckOnDelete": skip_resource_in_use_check_on_delete,
"Description": description,
"FoundationModel": foundation_model,
"GuardrailConfiguration": guardrail_configuration,
"MemoryConfiguration": memory_configuration,
"IdleSessionTTLInSeconds": idle_session_ttl_in_seconds,
"AgentCollaboration": agent_collaboration,
"Instruction": instruction,
"KnowledgeBases": knowledge_bases,
"AgentCollaborators": agent_collaborators,
"OrchestrationType": orchestration_type,
"PromptOverrideConfiguration": prompt_override_configuration,
"Tags": tags,
"TestAliasTags": test_alias_tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ agent_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.bedrock.agents
WHERE
Identifier = '{{ agent_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 agents resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
bedrock:CreateAgent,
bedrock:GetAgent,
bedrock:PrepareAgent,
bedrock:GetAgentKnowledgeBase,
bedrock:AssociateAgentKnowledgeBase,
bedrock:ListAgentKnowledgeBases,
bedrock:CreateAgentActionGroup,
bedrock:GetAgentActionGroup,
bedrock:ListAgentActionGroups,
bedrock:TagResource,
bedrock:ListTagsForResource,
bedrock:CreateGuardrail,
bedrock:CreateGuardrailVersion,
bedrock:GetGuardrail,
bedrock:AssociateAgentCollaborator,
bedrock:GetAgentCollaborator,
bedrock:ListAgentCollaborators,
iam:PassRole,
kms:GenerateDataKeyWithoutPlainText,
kms:ReEncryptFrom,
kms:ReEncryptTo,
kms:Decrypt,
kms:GenerateDataKey
bedrock:GetAgent,
bedrock:GetAgentActionGroup,
bedrock:ListAgentActionGroups,
bedrock:GetAgentKnowledgeBase,
bedrock:ListAgentKnowledgeBases,
bedrock:ListTagsForResource,
bedrock:GetGuardrail,
bedrock:GetAgentCollaborator,
bedrock:ListAgentCollaborators,
kms:Decrypt,
kms:GenerateDataKey,
kms:Encrypt
bedrock:GetAgent,
bedrock:UpdateAgent,
bedrock:PrepareAgent,
bedrock:GetAgentKnowledgeBase,
bedrock:UpdateAgentKnowledgeBase,
bedrock:AssociateAgentKnowledgeBase,
bedrock:DisassociateAgentKnowledgeBase,
bedrock:ListAgentKnowledgeBases,
bedrock:CreateAgentActionGroup,
bedrock:GetAgentActionGroup,
bedrock:UpdateAgentActionGroup,
bedrock:DeleteAgentActionGroup,
bedrock:ListAgentActionGroups,
bedrock:TagResource,
bedrock:UntagResource,
bedrock:ListTagsForResource,
bedrock:UpdateGuardrail,
bedrock:GetGuardrail,
bedrock:AssociateAgentCollaborator,
bedrock:GetAgentCollaborator,
bedrock:ListAgentCollaborators,
bedrock:DisassociateAgentCollaborator,
bedrock:UpdateAgentCollaborator,
kms:Decrypt,
kms:Encrypt,
kms:GenerateDataKey,
kms:GenerateDataKeyWithoutPlainText,
kms:ReEncryptFrom,
kms:ReEncryptTo,
iam:PassRole
bedrock:GetAgent,
bedrock:DeleteAgent,
bedrock:DeleteGuardrail,
bedrock:GetGuardrail,
kms:Decrypt,
kms:Encrypt,
kms:GenerateDataKey
bedrock:ListAgents,
bedrock:ListGuardrails