Class: AWSCDK::DynamoDB::TableBaseV2

Inherits:
Resource
  • Object
show all
Includes:
ITableV2, IAM::IResourceWithPolicy
Defined in:
dynamo_db/table_base_v2.rb

Overview

Base class for a DynamoDB table.

Direct Known Subclasses

TableV2, TableV2MultiAccountReplica

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ TableBaseV2

Returns a new instance of TableBaseV2.

Parameters:



13
14
15
16
17
18
19
# File 'dynamo_db/table_base_v2.rb', line 13

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::ResourceProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZXNvdXJjZVByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'dynamo_db/table_base_v2.rb', line 21

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :grants => { kind: :property, name: "grants", is_optional: false },
    :has_index => { kind: :property, name: "hasIndex", is_optional: false },
    :region => { kind: :property, name: "region", is_optional: false },
    :table_arn => { kind: :property, name: "tableArn", is_optional: false },
    :table_name => { kind: :property, name: "tableName", is_optional: false },
    :table_ref => { kind: :property, name: "tableRef", is_optional: false },
    :encryption_key => { kind: :property, name: "encryptionKey", is_optional: true },
    :table_id => { kind: :property, name: "tableId", is_optional: true },
    :table_stream_arn => { kind: :property, name: "tableStreamArn", is_optional: true },
    :resource_policy => { kind: :property, name: "resourcePolicy", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_to_resource_policy => { kind: :method, name: "addToResourcePolicy", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_full_access => { kind: :method, name: "grantFullAccess", is_optional: false },
    :grant_on_key => { kind: :method, name: "grantOnKey", is_optional: false },
    :grant_read_data => { kind: :method, name: "grantReadData", is_optional: false },
    :grant_read_write_data => { kind: :method, name: "grantReadWriteData", is_optional: false },
    :grant_stream => { kind: :method, name: "grantStream", is_optional: false },
    :grant_stream_read => { kind: :method, name: "grantStreamRead", is_optional: false },
    :grant_table_list_streams => { kind: :method, name: "grantTableListStreams", is_optional: false },
    :grant_write_data => { kind: :method, name: "grantWriteData", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_conditional_check_failed_requests => { kind: :method, name: "metricConditionalCheckFailedRequests", is_optional: false },
    :metric_consumed_read_capacity_units => { kind: :method, name: "metricConsumedReadCapacityUnits", is_optional: false },
    :metric_consumed_write_capacity_units => { kind: :method, name: "metricConsumedWriteCapacityUnits", is_optional: false },
    :metric_successful_request_latency => { kind: :method, name: "metricSuccessfulRequestLatency", is_optional: false },
    :metric_system_errors => { kind: :method, name: "metricSystemErrors", is_optional: false },
    :metric_system_errors_for_operations => { kind: :method, name: "metricSystemErrorsForOperations", is_optional: false },
    :metric_throttled_requests => { kind: :method, name: "metricThrottledRequests", is_optional: false },
    :metric_throttled_requests_for_operation => { kind: :method, name: "metricThrottledRequestsForOperation", is_optional: false },
    :metric_throttled_requests_for_operations => { kind: :method, name: "metricThrottledRequestsForOperations", is_optional: false },
    :metric_user_errors => { kind: :method, name: "metricUserErrors", is_optional: false },
  }
end

Instance Method Details

#add_to_resource_policy(statement) ⇒ AWSCDK::IAM::AddToResourcePolicyResult

Adds a statement to the resource policy associated with this table.

A resource policy will be automatically created upon the first call to add_to_resource_policy.

Note that this does not work with imported tables.

Parameters:

Returns:



280
281
282
283
# File 'dynamo_db/table_base_v2.rb', line 280

def add_to_resource_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToResourcePolicy", [statement])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



215
216
217
218
# File 'dynamo_db/table_base_v2.rb', line 215

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#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:



232
233
234
235
# File 'dynamo_db/table_base_v2.rb', line 232

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

#encryption_keyAWSCDK::KMS::IKey?

The KMS encryption key for the table.

Returns:



152
153
154
# File 'dynamo_db/table_base_v2.rb', line 152

def encryption_key()
  jsii_get_property("encryptionKey")
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.



86
87
88
# File 'dynamo_db/table_base_v2.rb', line 86

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


238
239
240
# File 'dynamo_db/table_base_v2.rb', line 238

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


252
253
254
255
256
257
# File 'dynamo_db/table_base_v2.rb', line 252

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


267
268
269
270
# File 'dynamo_db/table_base_v2.rb', line 267

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

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

Adds an IAM policy statement associated with this table to an IAM principal's policy.

Note: If encryption_key is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

[disable-awslint:no-grants]

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    the principal (no-op if undefined).

  • actions (Array<String>)

    the set of actions to allow (i.e., 'dynamodb:PutItem', 'dynamodb:GetItem', etc.).

Returns:



295
296
297
298
299
300
301
# File 'dynamo_db/table_base_v2.rb', line 295

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_full_access(grantee) ⇒ AWSCDK::IAM::Grant

Permits an IAM principal to all DynamoDB operations ('dynamodb:*') on this table.

Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

[disable-awslint:no-grants]

Parameters:

Returns:



312
313
314
315
# File 'dynamo_db/table_base_v2.rb', line 312

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

#grant_on_key(grantee, *actions) ⇒ AWSCDK::IAM::GrantOnKeyResult

Grants permissions on the table's encryption key.

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    the principal to grant access to.

  • actions (Array<String>)

    the KMS actions to grant.

Returns:



322
323
324
325
326
327
328
# File 'dynamo_db/table_base_v2.rb', line 322

def grant_on_key(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("grantOnKey", [grantee, *actions])
end

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

Permits an IAM principal all data read operations on this table.

Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.

Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

[disable-awslint:no-grants]

Parameters:

Returns:



341
342
343
344
# File 'dynamo_db/table_base_v2.rb', line 341

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

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

Permits an IAM principal to all data read/write operations on this table.

Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

[disable-awslint:no-grants]

Parameters:

Returns:



358
359
360
361
# File 'dynamo_db/table_base_v2.rb', line 358

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

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

Adds an IAM policy statement associated with this table to an IAM principal's policy.

Note: If encryption_key is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

[disable-awslint:no-grants]

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    the principal (no-op if undefined).

  • actions (Array<String>)

    the set of actions to allow (i.e., 'dynamodb:DescribeStream', 'dynamodb:GetRecords', etc.).

Returns:



373
374
375
376
377
378
379
# File 'dynamo_db/table_base_v2.rb', line 373

def grant_stream(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("grantStream", [grantee, *actions])
end

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

Adds an IAM policy statement associated with this table to an IAM principal's policy.

Actions: DescribeStream, GetRecords, GetShardIterator, ListStreams.

Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

[disable-awslint:no-grants]

Parameters:

Returns:



392
393
394
395
# File 'dynamo_db/table_base_v2.rb', line 392

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

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

Permits an IAM principal to list streams attached to this table.

[disable-awslint:no-grants]

Parameters:

Returns:



403
404
405
406
# File 'dynamo_db/table_base_v2.rb', line 403

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

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

Permits an IAM principal all data write operations on this table.

Actions: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

[disable-awslint:no-grants]

Parameters:

Returns:



419
420
421
422
# File 'dynamo_db/table_base_v2.rb', line 419

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

#grantsAWSCDK::DynamoDB::TableGrants

Grants for this table.



114
115
116
# File 'dynamo_db/table_base_v2.rb', line 114

def grants()
  jsii_get_property("grants")
end

#has_indexBoolean

Returns:

  • (Boolean)


119
120
121
# File 'dynamo_db/table_base_v2.rb', line 119

def has_index()
  jsii_get_property("hasIndex")
end

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

Return the given named metric for this table.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



432
433
434
435
436
437
# File 'dynamo_db/table_base_v2.rb', line 432

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_conditional_check_failed_requests(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Metric for the conditional check failed requests for this table.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



446
447
448
449
450
# File 'dynamo_db/table_base_v2.rb', line 446

def metric_conditional_check_failed_requests(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("metricConditionalCheckFailedRequests", [props])
end

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

Metric for the consumed read capacity units for this table.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



459
460
461
462
463
# File 'dynamo_db/table_base_v2.rb', line 459

def metric_consumed_read_capacity_units(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("metricConsumedReadCapacityUnits", [props])
end

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

Metric for the consumed write capacity units for this table.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



472
473
474
475
476
# File 'dynamo_db/table_base_v2.rb', line 472

def metric_consumed_write_capacity_units(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("metricConsumedWriteCapacityUnits", [props])
end

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

Metric for the successful request latency for this table.

By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



485
486
487
488
489
# File 'dynamo_db/table_base_v2.rb', line 485

def metric_successful_request_latency(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("metricSuccessfulRequestLatency", [props])
end

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

Deprecated.

use metricSystemErrorsForOperations.

Metric for the system errors this table.

Parameters:

Returns:



496
497
498
499
500
# File 'dynamo_db/table_base_v2.rb', line 496

def metric_system_errors(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("metricSystemErrors", [props])
end

#metric_system_errors_for_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric

Metric for the system errors for this table. This will sum errors across all possible operations.

By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



509
510
511
512
513
# File 'dynamo_db/table_base_v2.rb', line 509

def metric_system_errors_for_operations(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::DynamoDB::SystemErrorsForOperationsMetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuU3lzdGVtRXJyb3JzRm9yT3BlcmF0aW9uc01ldHJpY09wdGlvbnMifQ==")), "props") unless props.nil?
  jsii_call_method("metricSystemErrorsForOperations", [props])
end

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

Deprecated.

Do not use this function. It returns an invalid metric. Use metricThrottledRequestsForOperation instead.

How many requests are throttled on this table.

By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



523
524
525
526
527
# File 'dynamo_db/table_base_v2.rb', line 523

def metric_throttled_requests(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("metricThrottledRequests", [props])
end

#metric_throttled_requests_for_operation(operation, props = nil) ⇒ AWSCDK::CloudWatch::IMetric

How many requests are throttled on this table for the given operation.

By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



537
538
539
540
541
542
# File 'dynamo_db/table_base_v2.rb', line 537

def metric_throttled_requests_for_operation(operation, props = nil)
  Jsii::Type.check_type(operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operation")
  props = props.is_a?(Hash) ? ::AWSCDK::DynamoDB::OperationsMetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuT3BlcmF0aW9uc01ldHJpY09wdGlvbnMifQ==")), "props") unless props.nil?
  jsii_call_method("metricThrottledRequestsForOperation", [operation, props])
end

#metric_throttled_requests_for_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric

How many requests are throttled on this table. This will sum errors across all possible operations.

By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



551
552
553
554
555
# File 'dynamo_db/table_base_v2.rb', line 551

def metric_throttled_requests_for_operations(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::DynamoDB::OperationsMetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuT3BlcmF0aW9uc01ldHJpY09wdGlvbnMifQ==")), "props") unless props.nil?
  jsii_call_method("metricThrottledRequestsForOperations", [props])
end

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

Metric for the user errors for this table.

Note: This metric reports user errors across all the tables in the account and region the table resides in.

By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

Parameters:

Returns:



567
568
569
570
571
# File 'dynamo_db/table_base_v2.rb', line 567

def metric_user_errors(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("metricUserErrors", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


71
72
73
# File 'dynamo_db/table_base_v2.rb', line 71

def node()
  jsii_get_property("node")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


100
101
102
# File 'dynamo_db/table_base_v2.rb', line 100

def physical_name()
  jsii_get_property("physicalName")
end

#regionString

Returns:

  • (String)


124
125
126
# File 'dynamo_db/table_base_v2.rb', line 124

def region()
  jsii_get_property("region")
end

#resource_policyAWSCDK::IAM::PolicyDocument?

The resource policy for the table.

Returns:



173
174
175
# File 'dynamo_db/table_base_v2.rb', line 173

def resource_policy()
  jsii_get_property("resourcePolicy")
end

#resource_policy=(value) ⇒ Object



177
178
179
180
# File 'dynamo_db/table_base_v2.rb', line 177

def resource_policy=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeURvY3VtZW50In0=")), "resourcePolicy") unless value.nil?
  jsii_set_property("resourcePolicy", value)
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



107
108
109
# File 'dynamo_db/table_base_v2.rb', line 107

def stack()
  jsii_get_property("stack")
end

#table_arnString

The ARN of the table.

Returns:

  • (String)


131
132
133
# File 'dynamo_db/table_base_v2.rb', line 131

def table_arn()
  jsii_get_property("tableArn")
end

#table_idString?

The ID of the table.

Returns:

  • (String, nil)


159
160
161
# File 'dynamo_db/table_base_v2.rb', line 159

def table_id()
  jsii_get_property("tableId")
end

#table_nameString

The name of the table.

Returns:

  • (String)


138
139
140
# File 'dynamo_db/table_base_v2.rb', line 138

def table_name()
  jsii_get_property("tableName")
end

#table_refAWSCDK::Interfaces::AWSDynamodb::TableReference

A reference to this table.



145
146
147
# File 'dynamo_db/table_base_v2.rb', line 145

def table_ref()
  jsii_get_property("tableRef")
end

#table_stream_arnString?

The stream ARN of the table.

Returns:

  • (String, nil)


166
167
168
# File 'dynamo_db/table_base_v2.rb', line 166

def table_stream_arn()
  jsii_get_property("tableStreamArn")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


185
186
187
# File 'dynamo_db/table_base_v2.rb', line 185

def to_string()
  jsii_call_method("toString", [])
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. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


198
199
200
201
202
203
# File 'dynamo_db/table_base_v2.rb', line 198

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