Module: AWSCDK::BedrockAgentCore::IMemory

Includes:
IAM::IGrantable, IResource, Interfaces::AWSBedrockagentcore::IMemoryRef
Included in:
MemoryBase
Defined in:
bedrock_agent_core/i_memory.rb

Overview

Interface for Memory resources.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'bedrock_agent_core/i_memory.rb', line 301

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false },
    :memory_ref => { kind: :property, name: "memoryRef", is_optional: false },
    :memory_arn => { kind: :property, name: "memoryArn", is_optional: false },
    :memory_id => { kind: :property, name: "memoryId", is_optional: false },
    :created_at => { kind: :property, name: "createdAt", is_optional: true },
    :execution_role => { kind: :property, name: "executionRole", is_optional: true },
    :kms_key => { kind: :property, name: "kmsKey", is_optional: true },
    :status => { kind: :property, name: "status", is_optional: true },
    :updated_at => { kind: :property, name: "updatedAt", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_admin => { kind: :method, name: "grantAdmin", is_optional: false },
    :grant_delete => { kind: :method, name: "grantDelete", is_optional: false },
    :grant_delete_long_term_memory => { kind: :method, name: "grantDeleteLongTermMemory", is_optional: false },
    :grant_delete_short_term_memory => { kind: :method, name: "grantDeleteShortTermMemory", is_optional: false },
    :grant_full_access => { kind: :method, name: "grantFullAccess", is_optional: false },
    :grant_read => { kind: :method, name: "grantRead", is_optional: false },
    :grant_read_long_term_memory => { kind: :method, name: "grantReadLongTermMemory", is_optional: false },
    :grant_read_short_term_memory => { kind: :method, name: "grantReadShortTermMemory", is_optional: false },
    :grant_write => { kind: :method, name: "grantWrite", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_errors_for_api_operation => { kind: :method, name: "metricErrorsForApiOperation", is_optional: false },
    :metric_event_creation_count => { kind: :method, name: "metricEventCreationCount", is_optional: false },
    :metric_for_api_operation => { kind: :method, name: "metricForApiOperation", is_optional: false },
    :metric_invocations_for_api_operation => { kind: :method, name: "metricInvocationsForApiOperation", is_optional: false },
    :metric_latency_for_api_operation => { kind: :method, name: "metricLatencyForApiOperation", is_optional: false },
  }
end

Instance Method Details

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

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:



128
129
130
131
# File 'bedrock_agent_core/i_memory.rb', line 128

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#created_atString?

Timestamp when the memory was created.

Returns:

  • (String, nil)


70
71
72
# File 'bedrock_agent_core/i_memory.rb', line 70

def created_at()
  jsii_get_property("createdAt")
end

#envAWSCDK::Interfaces::ResourceEnvironment

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.



28
29
30
# File 'bedrock_agent_core/i_memory.rb', line 28

def env()
  jsii_get_property("env")
end

#execution_roleAWSCDK::IAM::IRole?

The IAM role that provides permissions for the memory to access AWS services.

Returns:



77
78
79
# File 'bedrock_agent_core/i_memory.rb', line 77

def execution_role()
  jsii_get_property("executionRole")
end

#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to perform actions on this memory.

Parameters:

Returns:



138
139
140
141
142
143
144
# File 'bedrock_agent_core/i_memory.rb', line 138

def grant(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grant", [grantee, *actions])
end

#grant_admin(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to manage the control plane of this memory.

Parameters:

Returns:



150
151
152
153
# File 'bedrock_agent_core/i_memory.rb', line 150

def grant_admin(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantAdmin", [grantee])
end

#grant_delete(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to delete content on this memory.

Parameters:

Returns:



159
160
161
162
# File 'bedrock_agent_core/i_memory.rb', line 159

def grant_delete(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantDelete", [grantee])
end

#grant_delete_long_term_memory(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.

Parameters:

Returns:



168
169
170
171
# File 'bedrock_agent_core/i_memory.rb', line 168

def grant_delete_long_term_memory(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantDeleteLongTermMemory", [grantee])
end

#grant_delete_short_term_memory(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.

Parameters:

Returns:



177
178
179
180
# File 'bedrock_agent_core/i_memory.rb', line 177

def grant_delete_short_term_memory(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantDeleteShortTermMemory", [grantee])
end

#grant_full_access(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to do every action on this memory.

Parameters:

Returns:



186
187
188
189
# File 'bedrock_agent_core/i_memory.rb', line 186

def grant_full_access(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantFullAccess", [grantee])
end

#grant_principalAWSCDK::IAM::IPrincipal

The principal to grant permissions to.



42
43
44
# File 'bedrock_agent_core/i_memory.rb', line 42

def grant_principal()
  jsii_get_property("grantPrincipal")
end

#grant_read(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to read the contents of this memory.

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

Parameters:

Returns:



197
198
199
200
# File 'bedrock_agent_core/i_memory.rb', line 197

def grant_read(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantRead", [grantee])
end

#grant_read_long_term_memory(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.

Parameters:

Returns:



206
207
208
209
# File 'bedrock_agent_core/i_memory.rb', line 206

def grant_read_long_term_memory(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantReadLongTermMemory", [grantee])
end

#grant_read_short_term_memory(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.

Parameters:

Returns:



215
216
217
218
# File 'bedrock_agent_core/i_memory.rb', line 215

def grant_read_short_term_memory(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantReadShortTermMemory", [grantee])
end

#grant_write(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given principal identity permissions to write content to this memory.

Parameters:

Returns:



224
225
226
227
# File 'bedrock_agent_core/i_memory.rb', line 224

def grant_write(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantWrite", [grantee])
end

#kms_keyAWSCDK::KMS::IKey?

Custom KMS key for encryption (if provided).

Returns:



84
85
86
# File 'bedrock_agent_core/i_memory.rb', line 84

def kms_key()
  jsii_get_property("kmsKey")
end

#memory_arnString

The ARN of the memory resource.

Returns:

  • (String)


56
57
58
# File 'bedrock_agent_core/i_memory.rb', line 56

def memory_arn()
  jsii_get_property("memoryArn")
end

#memory_idString

The id of the memory.

Returns:

  • (String)


63
64
65
# File 'bedrock_agent_core/i_memory.rb', line 63

def memory_id()
  jsii_get_property("memoryId")
end

#memory_refAWSCDK::Interfaces::AWSBedrockagentcore::MemoryReference

A reference to a Memory resource.



49
50
51
# File 'bedrock_agent_core/i_memory.rb', line 49

def memory_ref()
  jsii_get_property("memoryRef")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return the given named metric for this memory.

Parameters:

Returns:



234
235
236
237
238
239
# File 'bedrock_agent_core/i_memory.rb', line 234

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_errors_for_api_operation(operation, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return a metric containing the number of errors for a specific API operation performed on this memory.

Parameters:

Returns:



246
247
248
249
250
251
# File 'bedrock_agent_core/i_memory.rb', line 246

def metric_errors_for_api_operation(operation, props = nil)
  Jsii::Type.check_type(operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operation")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricErrorsForApiOperation", [operation, props])
end

#metric_event_creation_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Returns the metric containing the number of created memory events and memory records.

Parameters:

Returns:



257
258
259
260
261
# File 'bedrock_agent_core/i_memory.rb', line 257

def metric_event_creation_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricEventCreationCount", [props])
end

#metric_for_api_operation(metric_name, operation, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return the given named metric related to the API operation performed on this memory.

Parameters:

Returns:



269
270
271
272
273
274
275
# File 'bedrock_agent_core/i_memory.rb', line 269

def metric_for_api_operation(metric_name, operation, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  Jsii::Type.check_type(operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operation")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricForApiOperation", [metric_name, operation, props])
end

#metric_invocations_for_api_operation(operation, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return a metric containing the total number of API requests made for a specific memory operation.

Parameters:

Returns:



282
283
284
285
286
287
# File 'bedrock_agent_core/i_memory.rb', line 282

def metric_invocations_for_api_operation(operation, props = nil)
  Jsii::Type.check_type(operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operation")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricInvocationsForApiOperation", [operation, props])
end

#metric_latency_for_api_operation(operation, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return a metric measuring the latency of a specific API operation performed on this memory.

Parameters:

Returns:



294
295
296
297
298
299
# File 'bedrock_agent_core/i_memory.rb', line 294

def metric_latency_for_api_operation(operation, props = nil)
  Jsii::Type.check_type(operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operation")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricLatencyForApiOperation", [operation, props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


13
14
15
# File 'bedrock_agent_core/i_memory.rb', line 13

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



35
36
37
# File 'bedrock_agent_core/i_memory.rb', line 35

def stack()
  jsii_get_property("stack")
end

#statusString?

The status of the memory.

Returns:

  • (String, nil)


91
92
93
# File 'bedrock_agent_core/i_memory.rb', line 91

def status()
  jsii_get_property("status")
end

#updated_atString?

Timestamp when the memory was last updated.

Returns:

  • (String, nil)


98
99
100
# File 'bedrock_agent_core/i_memory.rb', line 98

def updated_at()
  jsii_get_property("updatedAt")
end

#with(*mixins) ⇒ Constructs::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 (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



109
110
111
112
113
114
# File 'bedrock_agent_core/i_memory.rb', line 109

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end