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 Details

    • Builder

      public Builder()
  • Method Details

    • description

      @Stability(Stable) public MemoryProps.Builder description(String description)
      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

      @Stability(Stable) public MemoryProps.Builder executionRole(IRole executionRole)
      Parameters:
      executionRole - The IAM role that provides permissions for the memory to access AWS services when using custom strategies.
      Returns:
      this
    • expirationDuration

      @Stability(Stable) public MemoryProps.Builder expirationDuration(Duration expirationDuration)
      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

      @Stability(Stable) public MemoryProps.Builder kmsKey(IKey kmsKey)
      Sets the value of MemoryProps.getKmsKey()
      Parameters:
      kmsKey - Custom KMS key to use for encryption.
      Returns:
      this
    • memoryName

      @Stability(Stable) public MemoryProps.Builder memoryName(String memoryName)
      Sets the value of MemoryProps.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)
      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)
      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

      @Stability(Stable) public MemoryProps.Builder tags(Map<String,String> tags)
      Sets the value of MemoryProps.getTags()
      Parameters:
      tags - Tags (optional) A list of key:value pairs of tags to apply to this memory resource.
      Returns:
      this
    • build

      @Stability(Stable) public MemoryProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<MemoryProps>
      Returns:
      a new instance of MemoryProps
      Throws:
      NullPointerException - if any required attribute was not provided