Class: AWSCDK::DynamoDB::TableBase

Inherits:
Resource
  • Object
show all
Includes:
ITable, IAM::IEncryptedResource, IAM::IResourceWithPolicy, Interfaces::AWSDynamodb::ITableRef
Defined in:
dynamo_db/table_base.rb

Direct Known Subclasses

Table

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TableBase.

Parameters:



14
15
16
17
18
19
20
# File 'dynamo_db/table_base.rb', line 14

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



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
67
68
# File 'dynamo_db/table_base.rb', line 22

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 },
    :regional_arns => { kind: :property, name: "regionalArns", is_optional: false },
    :stream_grants => { kind: :property, name: "streamGrants", 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 },
    :regions => { kind: :property, name: "regions", 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.



288
289
290
291
# File 'dynamo_db/table_base.rb', line 288

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:



227
228
229
230
# File 'dynamo_db/table_base.rb', line 227

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:



244
245
246
247
# File 'dynamo_db/table_base.rb', line 244

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?

KMS encryption key, if this table uses a customer-managed encryption key.

Returns:



164
165
166
# File 'dynamo_db/table_base.rb', line 164

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.



88
89
90
# File 'dynamo_db/table_base.rb', line 88

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


250
251
252
# File 'dynamo_db/table_base.rb', line 250

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)


264
265
266
267
268
269
# File 'dynamo_db/table_base.rb', line 264

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)


279
280
281
282
# File 'dynamo_db/table_base.rb', line 279

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.

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", ...).

Returns:



302
303
304
305
306
307
308
# File 'dynamo_db/table_base.rb', line 302

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 all DynamoDB operations ("dynamodb:*") to an IAM principal.

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

The use of this method is discouraged. Please use grants.fullAccess() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



321
322
323
324
# File 'dynamo_db/table_base.rb', line 321

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

Gives permissions to a grantable entity to perform actions on the encryption key.

Parameters:

Returns:



331
332
333
334
335
336
337
# File 'dynamo_db/table_base.rb', line 331

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 from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

The use of this method is discouraged. Please use grants.readData() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



350
351
352
353
# File 'dynamo_db/table_base.rb', line 350

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 to this table.

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

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

The use of this method is discouraged. Please use grants.readWriteData() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



369
370
371
372
# File 'dynamo_db/table_base.rb', line 369

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's stream to an IAM principal's policy.

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

The use of this method is discouraged. Please use streamGrants.stream() instead.

[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", ...).

Returns:



386
387
388
389
390
391
392
# File 'dynamo_db/table_base.rb', line 386

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

Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

The use of this method is discouraged. Please use streamGrants.streamRead() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



405
406
407
408
# File 'dynamo_db/table_base.rb', line 405

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 current dynamodb table.

The use of this method is discouraged. Please use streamGrants.tableListStreams() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



418
419
420
421
# File 'dynamo_db/table_base.rb', line 418

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 to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

The use of this method is discouraged. Please use grants.writeData() instead.

[disable-awslint:no-grants]

Parameters:

Returns:



434
435
436
437
# File 'dynamo_db/table_base.rb', line 434

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

Grant a predefined set of permissions on this Table.



116
117
118
# File 'dynamo_db/table_base.rb', line 116

def grants()
  jsii_get_property("grants")
end

#has_indexBoolean

Returns:

  • (Boolean)


121
122
123
# File 'dynamo_db/table_base.rb', line 121

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:



447
448
449
450
451
452
# File 'dynamo_db/table_base.rb', line 447

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



461
462
463
464
465
# File 'dynamo_db/table_base.rb', line 461

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



474
475
476
477
478
# File 'dynamo_db/table_base.rb', line 474

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



487
488
489
490
491
# File 'dynamo_db/table_base.rb', line 487

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



500
501
502
503
504
# File 'dynamo_db/table_base.rb', line 500

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:



511
512
513
514
515
# File 'dynamo_db/table_base.rb', line 511

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 this table.

This will sum errors across all possible operations. Note that 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:



525
526
527
528
529
# File 'dynamo_db/table_base.rb', line 525

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.

Default: sum over 5 minutes

Parameters:

Returns:



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

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

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

Default: sum over 5 minutes

Parameters:

Returns:



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

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::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("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. Note that 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:



566
567
568
569
570
# File 'dynamo_db/table_base.rb', line 566

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.

Note that 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:



582
583
584
585
586
# File 'dynamo_db/table_base.rb', line 582

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)


73
74
75
# File 'dynamo_db/table_base.rb', line 73

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)


102
103
104
# File 'dynamo_db/table_base.rb', line 102

def physical_name()
  jsii_get_property("physicalName")
end

#regional_arnsArray<String>

Deprecated.

This member is still filled but it is not read

Returns:

  • (Array<String>)


127
128
129
# File 'dynamo_db/table_base.rb', line 127

def regional_arns()
  jsii_get_property("regionalArns")
end

#regionsArray<String>?

Additional regions other than the main one that this table is replicated to.

Returns:

  • (Array<String>, nil)


171
172
173
# File 'dynamo_db/table_base.rb', line 171

def regions()
  jsii_get_property("regions")
end

#resource_policyAWSCDK::IAM::PolicyDocument?

Resource policy to assign to table.

Returns:



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

def resource_policy()
  jsii_get_property("resourcePolicy")
end

#resource_policy=(value) ⇒ Object



189
190
191
192
# File 'dynamo_db/table_base.rb', line 189

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:



109
110
111
# File 'dynamo_db/table_base.rb', line 109

def stack()
  jsii_get_property("stack")
end

#stream_grantsAWSCDK::DynamoDB::StreamGrants

Grant a predefined set of permissions on this Table's Stream, if present.

Will throw if the Table has not been configured for streaming.



136
137
138
# File 'dynamo_db/table_base.rb', line 136

def stream_grants()
  jsii_get_property("streamGrants")
end

#table_arnString

Arn of the dynamodb table.

Returns:

  • (String)


143
144
145
# File 'dynamo_db/table_base.rb', line 143

def table_arn()
  jsii_get_property("tableArn")
end

#table_nameString

Table name of the dynamodb table.

Returns:

  • (String)


150
151
152
# File 'dynamo_db/table_base.rb', line 150

def table_name()
  jsii_get_property("tableName")
end

#table_refAWSCDK::Interfaces::AWSDynamodb::TableReference

A reference to a Table resource.



157
158
159
# File 'dynamo_db/table_base.rb', line 157

def table_ref()
  jsii_get_property("tableRef")
end

#table_stream_arnString?

ARN of the table's stream, if there is one.

Returns:

  • (String, nil)


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

def table_stream_arn()
  jsii_get_property("tableStreamArn")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


197
198
199
# File 'dynamo_db/table_base.rb', line 197

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)


210
211
212
213
214
215
# File 'dynamo_db/table_base.rb', line 210

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