Class MemoryProps.Builder
java.lang.Object
software.amazon.awscdk.services.bedrockagentcore.MemoryProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MemoryProps>
- Enclosing interface:
MemoryProps
@Stability(Stable)
public static final class MemoryProps.Builder
extends Object
implements software.amazon.jsii.Builder<MemoryProps>
A builder for
MemoryProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.description(String description) Sets the value ofMemoryProps.getDescription()executionRole(IRole executionRole) Sets the value ofMemoryProps.getExecutionRole()expirationDuration(Duration expirationDuration) Sets the value ofMemoryProps.getExpirationDuration()Sets the value ofMemoryProps.getKmsKey()memoryName(String memoryName) Sets the value ofMemoryProps.getMemoryName()memoryStrategies(List<? extends IMemoryStrategy> memoryStrategies) Sets the value ofMemoryProps.getMemoryStrategies()streamDeliveryResources(List<? extends StreamDeliveryResource> streamDeliveryResources) Sets the value ofMemoryProps.getStreamDeliveryResources()Sets the value ofMemoryProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
description
Sets the value ofMemoryProps.getDescription()- Parameters:
description- Optional description for the memory Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.- Returns:
this
-
executionRole
Sets the value ofMemoryProps.getExecutionRole()- Parameters:
executionRole- The IAM role that provides permissions for the memory to access AWS services when using custom strategies.- Returns:
this
-
expirationDuration
Sets the value ofMemoryProps.getExpirationDuration()- Parameters:
expirationDuration- Short-term memory expiration in days (between 7 and 365). Sets the short-term (raw event) memory retention. Events older than the specified duration will expire and no longer be stored.- Returns:
this
-
kmsKey
Sets the value ofMemoryProps.getKmsKey()- Parameters:
kmsKey- Custom KMS key to use for encryption.- Returns:
this
-
memoryName
Sets the value ofMemoryProps.getMemoryName()- Parameters:
memoryName- The name of the memory Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.- Returns:
this
-
memoryStrategies
@Stability(Stable) public MemoryProps.Builder memoryStrategies(List<? extends IMemoryStrategy> memoryStrategies) Sets the value ofMemoryProps.getMemoryStrategies()- Parameters:
memoryStrategies- If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events.- Returns:
this
-
streamDeliveryResources
@Stability(Stable) public MemoryProps.Builder streamDeliveryResources(List<? extends StreamDeliveryResource> streamDeliveryResources) Sets the value ofMemoryProps.getStreamDeliveryResources()- Parameters:
streamDeliveryResources- Stream delivery resources for real-time push-based streaming of memory record lifecycle events (created, updated, deleted) to Amazon Kinesis Data Streams. The memory execution role will automatically be granted write permissions to each stream.Only one stream delivery resource is currently supported (CloudFormation maximum); providing more than one fails at synth with
TooManyStreamDeliveryResources:IStream stream; Memory.Builder.create(this, "Memory") .streamDeliveryResources(List.of(StreamDeliveryResource.kinesis(stream, KinesisStreamDeliveryOptions.builder() .contentConfigurations(List.of(StreamDeliveryContentConfiguration.builder() .type(StreamDeliveryContentType.MEMORY_RECORDS) .level(StreamDeliveryContentLevel.METADATA_ONLY) .build())) .build()))) .build();- Returns:
this
-
tags
Sets the value ofMemoryProps.getTags()- Parameters:
tags- Tags (optional) A list of key:value pairs of tags to apply to this memory resource.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<MemoryProps>- Returns:
- a new instance of
MemoryProps - Throws:
NullPointerException- if any required attribute was not provided
-