Skip to main content

agents

Creates, updates, deletes or gets an agent resource or lists agents in a region

Overview

Nameagents
TypeResource
DescriptionDefinition of AWS::Bedrock::Agent Resource Type
Idaws.bedrock.agents

Fields

NameDatatypeDescription
action_groupsarrayList of ActionGroups
agent_arnstringArn representation of the Agent.
agent_idstringIdentifier for a resource.
agent_namestringName for a resource.
agent_resource_role_arnstringARN of a IAM role.
agent_statusstringSchema Type for Action APIs.
agent_versionstringDraft Agent Version.
auto_preparebooleanSpecifies whether to automatically prepare after creating or updating the agent.
created_atstringTime Stamp.
customer_encryption_key_arnstringA KMS key ARN
skip_resource_in_use_check_on_deletebooleanSpecifies whether to allow deleting agent while it is in use.
descriptionstringDescription of the Resource.
failure_reasonsarrayFailure Reasons for Error.
foundation_modelstringARN or name of a Bedrock model.
idle_session_ttl_in_secondsnumberMax Session Time.
instructionstringInstruction for the agent.
knowledge_basesarrayList of Agent Knowledge Bases
prepared_atstringTime Stamp.
prompt_override_configurationobjectConfiguration for prompt override.
recommended_actionsarrayThe recommended actions users can take to resolve an error in failureReasons.
tagsobjectA map of tag keys and values
test_alias_tagsobjectA map of tag keys and values
updated_atstringTime Stamp.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTAgentName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all agents in a region.

SELECT
region,
action_groups,
agent_arn,
agent_id,
agent_name,
agent_resource_role_arn,
agent_status,
agent_version,
auto_prepare,
created_at,
customer_encryption_key_arn,
skip_resource_in_use_check_on_delete,
description,
failure_reasons,
foundation_model,
idle_session_ttl_in_seconds,
instruction,
knowledge_bases,
prepared_at,
prompt_override_configuration,
recommended_actions,
tags,
test_alias_tags,
updated_at
FROM aws.bedrock.agents
WHERE region = 'us-east-1';

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,
customer_encryption_key_arn,
skip_resource_in_use_check_on_delete,
description,
failure_reasons,
foundation_model,
idle_session_ttl_in_seconds,
instruction,
knowledge_bases,
prepared_at,
prompt_override_configuration,
recommended_actions,
tags,
test_alias_tags,
updated_at
FROM aws.bedrock.agents
WHERE region = 'us-east-1' AND data__Identifier = '<AgentId>';

INSERT example

Use the following StackQL query and manifest file to create a new agent resource, using stack-deploy.

/*+ create */
INSERT INTO aws.bedrock.agents (
AgentName,
region
)
SELECT
'{{ AgentName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.bedrock.agents
WHERE data__Identifier = '<AgentId>'
AND region = 'us-east-1';

Permissions

To operate on the agents resource, the following permissions are required:

Create

bedrock:CreateAgent,
bedrock:GetAgent,
bedrock:PrepareAgent,
bedrock:GetAgentKnowledgeBase,
bedrock:AssociateAgentKnowledgeBase,
bedrock:ListAgentKnowledgeBases,
bedrock:CreateAgentActionGroup,
bedrock:GetAgentActionGroup,
bedrock:ListAgentActionGroups,
bedrock:TagResource,
bedrock:ListTagsForResource,
iam:PassRole

Read

bedrock:GetAgent,
bedrock:GetAgentActionGroup,
bedrock:ListAgentActionGroups,
bedrock:GetAgentKnowledgeBase,
bedrock:ListAgentKnowledgeBases,
bedrock:ListTagsForResource

Update

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,
iam:PassRole

Delete

bedrock:GetAgent,
bedrock:DeleteAgent

List

bedrock:ListAgents