Experimental
@aws-cdk/aws-bedrock-agentcore-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
MemoryProps Struct
Properties for creating a Memory resource.
| Source | lib/memory/memory.ts |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
declare const key: kms.Key;
declare const memoryStrategy: bedrock_agentcore_alpha.IMemoryStrategy;
declare const role: iam.Role;
const memoryProps: bedrock_agentcore_alpha.MemoryProps = {
description: 'description',
executionRole: role,
expirationDuration: cdk.Duration.minutes(30),
kmsKey: key,
memoryName: 'memoryName',
memoryStrategies: [memoryStrategy],
tags: {
tagsKey: 'tags',
},
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
import aws_cdk as cdk
from aws_cdk import aws_iam as iam
from aws_cdk import aws_kms as kms
# key: kms.Key
# memory_strategy: bedrock_agentcore_alpha.IMemoryStrategy
# role: iam.Role
memory_props = bedrock_agentcore_alpha.MemoryProps(
description="description",
execution_role=role,
expiration_duration=cdk.Duration.minutes(30),
kms_key=key,
memory_name="memoryName",
memory_strategies=[memory_strategy],
tags={
"tags_key": "tags"
}
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.kms.*;
Key key;
IMemoryStrategy memoryStrategy;
Role role;
MemoryProps memoryProps = MemoryProps.builder()
.description("description")
.executionRole(role)
.expirationDuration(Duration.minutes(30))
.kmsKey(key)
.memoryName("memoryName")
.memoryStrategies(List.of(memoryStrategy))
.tags(Map.of(
"tagsKey", "tags"))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.KMS;
Key key;
IMemoryStrategy memoryStrategy;
Role role;
var memoryProps = new MemoryProps {
Description = "description",
ExecutionRole = role,
ExpirationDuration = Duration.Minutes(30),
KmsKey = key,
MemoryName = "memoryName",
MemoryStrategies = new [] { memoryStrategy },
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
}
};
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var key Key
var memoryStrategy IMemoryStrategy
var role Role
memoryProps := &MemoryProps{
Description: jsii.String("description"),
ExecutionRole: role,
ExpirationDuration: cdk.Duration_Minutes(jsii.Number(30)),
KmsKey: key,
MemoryName: jsii.String("memoryName"),
MemoryStrategies: []IMemoryStrategy{
memoryStrategy,
},
Tags: map[string]*string{
"tagsKey": jsii.String("tags"),
},
}
Properties
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #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.
Default: No description
executionRoleoptionalIRoleexecution_roleoptionalIRoleexecutionRoleoptionalIRoleExecutionRoleoptionalIRoleExecutionRoleoptionalIRole #The IAM role that provides permissions for the memory to access AWS services when using custom strategies.
Default: A new role will be created.
expirationDurationoptionalDurationexpiration_durationoptionalDurationexpirationDurationoptionalDurationExpirationDurationoptionalDurationExpirationDurationoptionalDuration #Short-term memory expiration in days (between 7 and 365).
Default: 90 days
Sets the short-term (raw event) memory retention. Events older than the specified duration will expire and no longer be stored.
Custom KMS key to use for encryption.
Default: Your data is encrypted with a key that AWS owns and manages for you
memoryNameoptionalstringmemory_nameoptionalstrmemoryNameoptionalStringMemoryNameoptionalstringMemoryNameoptional*string #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}.
Default: auto generate
memoryStrategiesoptionalIMemoryStrategy[]memory_strategiesoptionaltyping.List[IMemoryStrategy]memoryStrategiesoptionalList<IMemoryStrategy>MemoryStrategiesoptionalIMemoryStrategy[]MemoryStrategiesoptional*[]IMemoryStrategy #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.
Default: No extraction strategies (short term memory only)
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #Tags (optional) A list of key:value pairs of tags to apply to this memory resource.
Default: no tags