Memory
- class aws_cdk.aws_bedrock_agentcore_alpha.Memory(scope, id, *, memory_name, description=None, execution_role=None, expiration_duration=None, kms_key=None, memory_strategies=None, tags=None)
Bases:
MemoryBase(experimental) Long-term memory store for extracted insights like user preferences, semantic facts and summaries.
Enables knowledge retention across sessions by storing user preferences (e.g. coding style), semantic facts (e.g. learned info) and interaction summaries for context optimization.
- See:
https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html
- Stability:
experimental
- Resource:
AWS::BedrockAgentCore::Memory
- ExampleMetadata:
fixture=default infused
Example:
# Create a custom execution role execution_role = iam.Role(self, "MemoryExecutionRole", assumed_by=iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"), managed_policies=[ iam.ManagedPolicy.from_aws_managed_policy_name("AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy") ] ) # Create memory with custom execution role memory = agentcore.Memory(self, "MyMemory", memory_name="my_memory", description="Memory with custom execution role", expiration_duration=cdk.Duration.days(90), execution_role=execution_role )
- Parameters:
scope (
Construct)id (
str)memory_name (
str) – (experimental) 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}.description (
Optional[str]) – (experimental) 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 descriptionexecution_role (
Optional[IRole]) – (experimental) The IAM role that provides permissions for the memory to access AWS services when using custom strategies. Default: A new role will be created.expiration_duration (
Optional[Duration]) – (experimental) 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. Default: 90kms_key (
Optional[IKey]) – (experimental) Custom KMS key to use for encryption. Default: Your data is encrypted with a key that AWS owns and manages for youmemory_strategies (
Optional[Sequence[IMemoryStrategy]]) – (experimental) 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)tags (
Optional[Mapping[str,str]]) – (experimental) Tags (optional) A list of key:value pairs of tags to apply to this memory resource. Default: {} no tags
- Stability:
experimental
Methods
- add_memory_strategy(memory_strategy)
(experimental) Add memory strategy to the memory.
- Parameters:
memory_strategy (
IMemoryStrategy)- Default:
No memory strategies.
- Stability:
experimental
- Return type:
None
- apply_removal_policy(policy)
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).- Parameters:
policy (
RemovalPolicy)- Return type:
None
- grant(grantee, *actions)
(experimental) Grants IAM actions to the IAM Principal.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant permissions to.
actions (
str) –The actions to grant.
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_admin(grantee)
(experimental) Grant the given principal identity permissions to manage the control plane of this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant admin permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:CreateMemory’,
‘bedrock-agentcore:GetMemory’, ‘bedrock-agentcore:DeleteMemory’, ‘bedrock-agentcore:UpdateMemory’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_delete(grantee)
(experimental) Grant the given principal identity permissions to delete content on this memory.
Both Short-Term Memory (STM) and Long-Term Memory (LTM).
- Parameters:
grantee (
IGrantable) –The IAM principal to grant delete permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:DeleteEvent’,
‘bedrock-agentcore:DeleteMemoryRecord’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_delete_long_term_memory(grantee)
(experimental) Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant delete permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:DeleteMemoryRecord’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_delete_short_term_memory(grantee)
(experimental) Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant delete permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:DeleteEvent’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_full_access(grantee)
(experimental) Grant the given principal identity permissions to do every action on this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant full access permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:CreateEvent’,
‘bedrock-agentcore:GetEvent’, ‘bedrock-agentcore:DeleteEvent’, ‘bedrock-agentcore:GetMemoryRecord’, ‘bedrock-agentcore:RetrieveMemoryRecords’, ‘bedrock-agentcore:ListMemoryRecords’, ‘bedrock-agentcore:ListActors’, ‘bedrock-agentcore:ListSessions’, ‘bedrock-agentcore:CreateMemory’, ‘bedrock-agentcore:GetMemory’, ‘bedrock-agentcore:DeleteMemory’, ‘bedrock-agentcore:UpdateMemory’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_read(grantee)
(experimental) Grant the given principal identity permissions to read the contents of this memory.
Both Short-Term Memory (STM) and Long-Term Memory (LTM).
- Parameters:
grantee (
IGrantable) –The IAM principal to grant read permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:GetMemoryRecord’,
‘bedrock-agentcore:RetrieveMemoryRecords’, ‘bedrock-agentcore:ListMemoryRecords’, ‘bedrock-agentcore:ListActors’, ‘bedrock-agentcore:ListSessions] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_read_long_term_memory(grantee)
(experimental) Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant read permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:GetMemoryRecord’,
‘bedrock-agentcore:RetrieveMemoryRecords’, ‘bedrock-agentcore:ListMemoryRecords’, ‘bedrock-agentcore:ListActors’, ‘bedrock-agentcore:ListSessions’,] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_read_short_term_memory(grantee)
(experimental) Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant read permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:GetEvent’,
‘bedrock-agentcore:ListEvents’, ‘bedrock-agentcore:ListActors’, ‘bedrock-agentcore:ListSessions’,] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_write(grantee)
(experimental) Grant the given principal identity permissions to write content to short-term memory.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant read permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:CreateEvent’] on this.memoryArn
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- metric(metric_name, dimensions, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return the given named metric for this memory.
By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the
statisticandperiodproperties.- Parameters:
metric_name (
str)dimensions (
Mapping[str,str])account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) – Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No labelperiod (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_errors_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return a metric containing the number of errors for a specific API operation performed on this memory.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_event_creation_count(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Returns the metric containing the number of short-term memory events.
- Parameters:
account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_for_api_operation(metric_name, operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return the given named metric related to the API operation performed on this memory.
- Parameters:
metric_name (
str)operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_invocations_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return a metric containing the total number of API requests made for a specific memory operation like
CreateEvent,ListEvents,RetrieveMemoryRecords…- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_latency_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return a metric measuring the latency of a specific API operation performed on this memory.
The latency metric represents the total time elapsed between receiving the request and sending the final response token, measuring complete end-to-end processing time.
For memory creation events specifically, this measures the time from the last CreateEvent that met strategy criteria until memory storage is completed.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_memory_record_creation_count(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Returns the metric containing the number of long-term memory records created by the long-term extraction strategies.
- Parameters:
account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- PROPERTY_INJECTION_ID = '@aws-cdk.aws-bedrock-agentcore-alpha.Memory'
- created_at
(experimental) The created timestamp of the memory.
- Stability:
experimental
- description
(experimental) The description of the memory.
- Stability:
experimental
- env
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.
- execution_role
(experimental) The execution role of the memory.
- Stability:
experimental
- expiration_duration
(experimental) The expiration days of the memory.
- Stability:
experimental
- failure_reason
(experimental) The failure reason of the browser.
- Stability:
experimental
- Attribute:
true
- grant_principal
(experimental) The principal to grant permissions to.
- Stability:
experimental
- kms_key
(experimental) The KMS key used to encrypt the memory.
- Stability:
experimental
- memory_arn
(experimental) The ARN of the memory resource.
- Stability:
experimental
- Attribute:
true
- memory_id
(experimental) The id of the memory.
- Stability:
experimental
- Attribute:
true
- memory_name
(experimental) The name of the memory.
- Stability:
experimental
- Attribute:
true
- memory_strategies
(experimental) The memory strategies used by the memory.
- Stability:
experimental
- Attribute:
true
- node
The tree node.
- stack
The stack in which this resource is defined.
- status
(experimental) The status of the memory.
- Stability:
experimental
- tags
(experimental) Tags applied to this browser resource A map of key-value pairs for resource tagging.
- Default:
No tags applied
- Stability:
experimental
- updated_at
(experimental) The updated at timestamp of the memory.
- Stability:
experimental
Static Methods
- classmethod from_memory_attributes(scope, id, *, memory_arn, role_arn, created_at=None, kms_key_arn=None, status=None, updated_at=None)
(experimental) Creates an Memory reference from an existing memory’s attributes.
- Parameters:
scope (
Construct) –The construct scope.
id (
str) –Identifier of the construct.
memory_arn (
str) – (experimental) The ARN of the memory.role_arn (
str) – (experimental) The ARN of the IAM role associated to the memory.created_at (
Optional[str]) – (experimental) The created timestamp of the memory. Default: undefined - No created timestamp is providedkms_key_arn (
Optional[str]) – (experimental) Optional KMS encryption key associated with this memory. Default: undefined - An AWS managed key is usedstatus (
Optional[str]) – (experimental) The status of the memory. Default: undefined - No status is providedupdated_at (
Optional[str]) – (experimental) When this memory was last updated. Default: undefined - No last updated timestamp is provided
- Return type:
- Returns:
An IBrowserCustom reference to the existing browser
- Stability:
experimental
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct)- Return type:
bool