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
Idawscc.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.
custom_orchestrationobjectStructure for custom orchestration
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.
guardrail_configurationobjectConfiguration for a guardrail
memory_configurationobjectConfiguration for memory storage
idle_session_ttl_in_secondsnumberMax Session Time.
agent_collaborationstringAgent collaboration state
instructionstringInstruction for the agent.
knowledge_basesarrayList of Agent Knowledge Bases
agent_collaboratorsarrayList of Agent Collaborators
orchestration_typestringTypes of orchestration strategy for agents
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
updated_atstringTime Stamp.
regionstringAWS region.

For more information, see AWS::Bedrock::Agent.

Methods

NameResourceAccessible byRequired Params
create_resourceagentsINSERTAgentName, region
delete_resourceagentsDELETEIdentifier, region
update_resourceagentsUPDATEIdentifier, PatchDocument, region
list_resourcesagents_list_onlySELECTregion
get_resourceagentsSELECTIdentifier, region

SELECT examples

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 = 'us-east-1' AND
Identifier = '{{ agent_id }}';

INSERT example

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

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

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 }}';

DELETE example

/*+ delete */
DELETE FROM awscc.bedrock.agents
WHERE
Identifier = '{{ agent_id }}' AND
region = 'us-east-1';

Permissions

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

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