# IMemory

Interface for Memory resources.

Extends: [IResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResource.html), [IGrantable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IGrantable.html), [IMemoryRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_bedrockagentcore.IMemoryRef.html)
Implemented by: [Memory](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.Memory.html), [MemoryBase](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.MemoryBase.html)
Obtainable from: [Memory.fromMemoryAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.Memory.html#frommemoryattributes)

- Source: [`aws-bedrockagentcore/lib/memory/memory.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/memory/memory.ts#L176)
- Type last changed: v2.255.0 · 19 May 2026

## Properties

- `createdAt`: string — Timestamp when the memory was created.

- `env`: [ResourceEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `executionRole`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role that provides permissions for the memory to access AWS services.

- `grantPrincipal`: [IPrincipal](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IPrincipal.html) — The principal to grant permissions to.

- `kmsKey`: [IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — Custom KMS key for encryption (if provided).

- `memoryArn`: string — The ARN of the memory resource.

- `memoryId`: string — The id of the memory.

- `memoryRef`: [MemoryReference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_bedrockagentcore.MemoryReference.html) — A reference to a Memory resource.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `stack`: [Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

- `status`: string — The status of the memory.

- `updatedAt`: string — Timestamp when the memory was last updated.

## Methods

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `grant(grantee: IGrantable, ...actions: string[]): Grant` — Grant the given principal identity permissions to perform actions on this memory.

- `grantAdmin(grantee: IGrantable): Grant` — Grant the given principal identity permissions to manage the control plane of this memory.

- `grantDelete(grantee: IGrantable): Grant` — Grant the given principal identity permissions to delete content on this memory.

- `grantDeleteLongTermMemory(grantee: IGrantable): Grant` — Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.

- `grantDeleteShortTermMemory(grantee: IGrantable): Grant` — Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.

- `grantFullAccess(grantee: IGrantable): Grant` — Grant the given principal identity permissions to do every action on this memory.

- `grantRead(grantee: IGrantable): Grant` — Grant the given principal identity permissions to read the contents of this memory.

  Both Short-Term Memory (STM) and Long-Term Memory (LTM).

- `grantReadLongTermMemory(grantee: IGrantable): Grant` — Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.

- `grantReadShortTermMemory(grantee: IGrantable): Grant` — Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.

- `grantWrite(grantee: IGrantable): Grant` — Grant the given principal identity permissions to write content to this memory.

- `metric(metricName: string, props?: MetricOptions): Metric` — Return the given named metric for this memory.

- `metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the number of errors for a specific API operation performed on this memory.

- `metricEventCreationCount(props?: MetricOptions): Metric` — Returns the metric containing the number of created memory events and memory records.

- `metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric` — Return the given named metric related to the API operation performed on this memory.

- `metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the total number of API requests made for a specific memory operation.

- `metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric measuring the latency of a specific API operation performed on this memory.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
