This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
AWS::Bedrock::Session
Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of conversations at checkpoints, with the added security and infrastructure of AWS. For more information, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
By default, Amazon Bedrock uses AWS-managed keys for session encryption, including session metadata, or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.
Note
You use a session to store state and conversation history for generative AI applications built with open-source frameworks. For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the InvokeAgent API operation.
Related APIs:
Syntax
To declare this entity in your CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Bedrock::Session", "Properties" : { "EncryptionKeyArn" :String, "SessionMetadata" :{, "Tags" :Key:Value, ...}[ Tag, ... ]} }
YAML
Type: AWS::Bedrock::Session Properties: EncryptionKeyArn:StringSessionMetadata:Tags:Key:Value- Tag
Properties
EncryptionKeyArnProperty description not available.
Required: No
Type: String
Pattern:
^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$Minimum:
1Maximum:
2048Update requires: Replacement
SessionMetadata-
Provides information about the execution process for different types of invocations, such as model invocation, knowledge base invocation, agent collaborator invocation, guardrail invocation, and code interpreter Invocation.
Required: No
Type: Object of String
Pattern:
^[\s\S]{1,100}$Maximum:
5000Update requires: No interruption
Property description not available.
Required: No
Type: Array of Tag
Maximum:
200Update requires: No interruption
Return values
Ref
Fn::GetAtt
CreatedAt-
The timestamp for when the session was created.
LastUpdatedAt-
The timestamp for when the session was last modified.
SessionArn-
The Amazon Resource Name (ARN) of the session.
SessionId-
The unique identifier for the session.
SessionStatus-
The current status of the session.