sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.bedrock_agentcore.sessions |
Fields
The following fields are returned by SELECT queries:
- list_sessions
| Name | Datatype | Description |
|---|---|---|
actor_id | string | The identifier of the actor associated with the session. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-/]*(?::[a-zA-Z0-9-/]+)[a-zA-Z0-9-_/]</code>) |
created_at | string (date-time) | The timestamp when the session was created. |
session_id | string | The unique identifier of the session. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-_]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_sessions | select | memory_id, actor_id, region | Lists sessions in an AgentCore Memory resource based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully. Empty sessions are automatically deleted after one day. To use this operation, you must have the bedrock-agentcore:ListSessions permission. | |
update_browser_stream | update | browser_identifier, sessionId, region, streamUpdate | Updates a browser stream. To use this operation, you must have permissions to perform the bedrock:UpdateBrowserStream action. | |
delete_capacity_provider_session | delete | capacity_provider_id, session_id, region | Deletes a session associated with a capacity provider in Amazon Bedrock AgentCore and makes the session unavailable for further use. To delete a capacity provider session, specify both the capacity provider identifier and the session ID. After you delete a session, you cannot restart it. | |
save_browser_session_profile | exec | profile_identifier, region, browserIdentifier, sessionId | X-Amzn-Trace-Id, traceparent | Saves the current state of a browser session as a reusable profile in Amazon Bedrock AgentCore. A browser profile captures persistent browser data such as cookies and local storage from an active session, enabling you to reuse this data in future browser sessions. To save a browser session profile, you must specify the profile identifier, browser identifier, and session ID. The session must be active when saving the profile. Once saved, the profile can be used with the StartBrowserSession operation to initialize new sessions with the stored browser state. Browser profiles are useful for scenarios that require persistent authentication, maintaining user preferences across sessions, or continuing tasks that depend on previously stored browser data. The following operations are related to SaveBrowserSessionProfile: StartBrowserSession GetBrowserSession |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
actor_id | string | The identifier of the actor for which to list sessions. |
browser_identifier | string | The identifier of the browser. |
capacity_provider_id | string | The unique identifier of the capacity provider associated with the session. |
memory_id | string | The identifier of the AgentCore Memory resource for which to list sessions. |
profile_identifier | string | The unique identifier for the browser profile. This identifier is used to reference the profile when starting new browser sessions. The identifier must follow the pattern of an alphanumeric name (up to 48 characters) followed by a hyphen and a 10-character alphanumeric suffix. |
region | string | AWS region (default: us-east-1) |
sessionId | string | The identifier of the browser session. |
session_id | string | The unique identifier of the capacity provider session to delete. |
X-Amzn-Trace-Id | string | The trace identifier for request tracking. |
traceparent | string | The parent trace information for distributed tracing. |
SELECT examples
- list_sessions
Lists sessions in an AgentCore Memory resource based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully. Empty sessions are automatically deleted after one day. To use this operation, you must have the bedrock-agentcore:ListSessions permission.
SELECT
actor_id,
created_at,
session_id
FROM aws.bedrock_agentcore.sessions
WHERE memory_id = '{{ memory_id }}' -- required
AND actor_id = '{{ actor_id }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- update_browser_stream
Updates a browser stream. To use this operation, you must have permissions to perform the bedrock:UpdateBrowserStream action.
UPDATE aws.bedrock_agentcore.sessions
SET
streamUpdate = '{{ streamUpdate }}',
clientToken = '{{ clientToken }}'
WHERE
browser_identifier = '{{ browser_identifier }}' --required
AND sessionId = '{{ sessionId }}' --required
AND region = '{{ region }}' --required
AND streamUpdate = '{{ streamUpdate }}' --required
RETURNING
browser_identifier,
session_id,
streams,
updated_at;
DELETE examples
- delete_capacity_provider_session
Deletes a session associated with a capacity provider in Amazon Bedrock AgentCore and makes the session unavailable for further use. To delete a capacity provider session, specify both the capacity provider identifier and the session ID. After you delete a session, you cannot restart it.
DELETE FROM aws.bedrock_agentcore.sessions
WHERE capacity_provider_id = '{{ capacity_provider_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- save_browser_session_profile
Saves the current state of a browser session as a reusable profile in Amazon Bedrock AgentCore. A browser profile captures persistent browser data such as cookies and local storage from an active session, enabling you to reuse this data in future browser sessions. To save a browser session profile, you must specify the profile identifier, browser identifier, and session ID. The session must be active when saving the profile. Once saved, the profile can be used with the StartBrowserSession operation to initialize new sessions with the stored browser state. Browser profiles are useful for scenarios that require persistent authentication, maintaining user preferences across sessions, or continuing tasks that depend on previously stored browser data. The following operations are related to SaveBrowserSessionProfile: StartBrowserSession GetBrowserSession
EXEC aws.bedrock_agentcore.sessions.save_browser_session_profile
@profile_identifier='{{ profile_identifier }}' --required,
@region='{{ region }}' --required,
@X-Amzn-Trace-Id='{{ X-Amzn-Trace-Id }}',
@traceparent='{{ traceparent }}'
@@json=
'{
"browserIdentifier": "{{ browserIdentifier }}",
"sessionId": "{{ sessionId }}",
"clientToken": "{{ clientToken }}"
}'
;