Module: AWSCDK::DynamoDB::ITableV2
Overview
Represents an instance of a DynamoDB table.
Class Method Summary collapse
Instance Method Summary collapse
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#encryption_key ⇒ AWSCDK::KMS::IKey?
Optional KMS encryption key associated with this table.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this table to an IAM principal's policy.
-
#grant_full_access(grantee) ⇒ AWSCDK::IAM::Grant
Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
-
#grant_read_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan.
-
#grant_read_write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal to all data read/write operations to this table.
-
#grant_stream(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
-
#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.
-
#grant_table_list_streams(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM Principal to list streams attached to current dynamodb table.
-
#grant_write_data(grantee) ⇒ AWSCDK::IAM::Grant
Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem.
-
#grants ⇒ AWSCDK::DynamoDB::TableGrants
Grants for this table.
-
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of Errors executing all Lambdas.
-
#metric_conditional_check_failed_requests(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the conditional check failed requests.
-
#metric_consumed_read_capacity_units(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the consumed read capacity units.
-
#metric_consumed_write_capacity_units(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the consumed write capacity units.
-
#metric_successful_request_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the successful request latency.
-
#metric_system_errors_for_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric
Metric for the system errors this table.
-
#metric_throttled_requests(props = nil) ⇒ AWSCDK::CloudWatch::Metric
deprecated
Deprecated.
use
metricThrottledRequestsForOperations -
#metric_throttled_requests_for_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric
Metric for throttled requests.
-
#metric_user_errors(props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the user errors.
-
#node ⇒ Constructs::Node
The tree node.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#table_arn ⇒ String
Arn of the dynamodb table.
-
#table_id ⇒ String?
The ID of the table.
-
#table_name ⇒ String
Table name of the dynamodb table.
-
#table_ref ⇒ AWSCDK::Interfaces::AWSDynamodb::TableReference
A reference to a Table resource.
-
#table_stream_arn ⇒ String?
ARN of the table's stream, if there is one.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'dynamo_db/i_table_v2.rb', line 314 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 }, :table_ref => { kind: :property, name: "tableRef", is_optional: false }, :table_arn => { kind: :property, name: "tableArn", is_optional: false }, :table_name => { kind: :property, name: "tableName", is_optional: false }, :encryption_key => { kind: :property, name: "encryptionKey", is_optional: true }, :table_stream_arn => { kind: :property, name: "tableStreamArn", is_optional: true }, :grants => { kind: :property, name: "grants", is_optional: false }, :table_id => { kind: :property, name: "tableId", 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_full_access => { kind: :method, name: "grantFullAccess", 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_for_operations => { kind: :method, name: "metricSystemErrorsForOperations", is_optional: false }, :metric_throttled_requests => { kind: :method, name: "metricThrottledRequests", 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
#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).
112 113 114 115 |
# File 'dynamo_db/i_table_v2.rb', line 112 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#encryption_key ⇒ AWSCDK::KMS::IKey?
Optional KMS encryption key associated with this table.
61 62 63 |
# File 'dynamo_db/i_table_v2.rb', line 61 def encryption_key() jsii_get_property("encryptionKey") end |
#env ⇒ AWSCDK::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.
26 27 28 |
# File 'dynamo_db/i_table_v2.rb', line 26 def env() jsii_get_property("env") 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.
125 126 127 128 129 130 131 |
# File 'dynamo_db/i_table_v2.rb', line 125 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.
140 141 142 143 |
# File 'dynamo_db/i_table_v2.rb', line 140 def grant_full_access(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("grantFullAccess", [grantee]) 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.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
152 153 154 155 |
# File 'dynamo_db/i_table_v2.rb', line 152 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
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
167 168 169 170 |
# File 'dynamo_db/i_table_v2.rb', line 167 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.
180 181 182 183 184 185 186 |
# File 'dynamo_db/i_table_v2.rb', line 180 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.
195 196 197 198 |
# File 'dynamo_db/i_table_v2.rb', line 195 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.
204 205 206 207 |
# File 'dynamo_db/i_table_v2.rb', line 204 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.
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
216 217 218 219 |
# File 'dynamo_db/i_table_v2.rb', line 216 def grant_write_data(grantee) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") jsii_call_method("grantWriteData", [grantee]) end |
#grants ⇒ AWSCDK::DynamoDB::TableGrants
Grants for this table.
75 76 77 |
# File 'dynamo_db/i_table_v2.rb', line 75 def grants() jsii_get_property("grants") end |
#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric
Metric for the number of Errors executing all Lambdas.
226 227 228 229 230 231 |
# File 'dynamo_db/i_table_v2.rb', line 226 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.
237 238 239 240 241 |
# File 'dynamo_db/i_table_v2.rb', line 237 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.
247 248 249 250 251 |
# File 'dynamo_db/i_table_v2.rb', line 247 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.
257 258 259 260 261 |
# File 'dynamo_db/i_table_v2.rb', line 257 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.
267 268 269 270 271 |
# File 'dynamo_db/i_table_v2.rb', line 267 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_for_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric
Metric for the system errors this table.
277 278 279 280 281 |
# File 'dynamo_db/i_table_v2.rb', line 277 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
use metricThrottledRequestsForOperations
Metric for throttled requests.
288 289 290 291 292 |
# File 'dynamo_db/i_table_v2.rb', line 288 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_operations(props = nil) ⇒ AWSCDK::CloudWatch::IMetric
Metric for throttled requests.
298 299 300 301 302 |
# File 'dynamo_db/i_table_v2.rb', line 298 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.
308 309 310 311 312 |
# File 'dynamo_db/i_table_v2.rb', line 308 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 |
#node ⇒ Constructs::Node
The tree node.
11 12 13 |
# File 'dynamo_db/i_table_v2.rb', line 11 def node() jsii_get_property("node") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
33 34 35 |
# File 'dynamo_db/i_table_v2.rb', line 33 def stack() jsii_get_property("stack") end |
#table_arn ⇒ String
Arn of the dynamodb table.
47 48 49 |
# File 'dynamo_db/i_table_v2.rb', line 47 def table_arn() jsii_get_property("tableArn") end |
#table_id ⇒ String?
The ID of the table.
82 83 84 |
# File 'dynamo_db/i_table_v2.rb', line 82 def table_id() jsii_get_property("tableId") end |
#table_name ⇒ String
Table name of the dynamodb table.
54 55 56 |
# File 'dynamo_db/i_table_v2.rb', line 54 def table_name() jsii_get_property("tableName") end |
#table_ref ⇒ AWSCDK::Interfaces::AWSDynamodb::TableReference
A reference to a Table resource.
40 41 42 |
# File 'dynamo_db/i_table_v2.rb', line 40 def table_ref() jsii_get_property("tableRef") end |
#table_stream_arn ⇒ String?
ARN of the table's stream, if there is one.
68 69 70 |
# File 'dynamo_db/i_table_v2.rb', line 68 def table_stream_arn() jsii_get_property("tableStreamArn") 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.
93 94 95 96 97 98 |
# File 'dynamo_db/i_table_v2.rb', line 93 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 |