Skip to content
v2.273.0

ITable Interface ​

An interface that represents a DynamoDB Table - either created with the CDK, or an existing one.

Properties ​

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey#
Optional KMS encryption key associated with this table.
The environment this resource belongs to.
notes

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.

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
tableArnstringtable_arnstrtableArnStringTableArnstringTableArn*stringrequired#
Arn of the dynamodb table.
tableNamestringtable_namestrtableNameStringTableNamestringTableName*stringrequired#
Table name of the dynamodb table.
tableRefTableReferencetable_refTableReferencetableRefTableReferenceTableRefTableReferenceTableRefTableReferencerequired#
A reference to a Table resource.
tableStreamArnstringtable_stream_arnstrtableStreamArnStringTableStreamArnstringTableStreamArn*string#
ARN of the table's stream, if there is one.

Methods ​

applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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

grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#
Adds an IAM policy statement associated with this table to an IAM principal's policy.

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

2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — The principal (no-op if undefined).
  • actionsactionsactionsactionsActions — The set of actions to allow (i.e. "dynamodb:PutItem", "dynamodb:GetItem", ...).
grantFullAccess(grantee: IGrantable): Grantdef grant_full_access(self, grantee: IGrantable) -> Grantpublic Grant grantFullAccess(IGrantable grantee)public Grant GrantFullAccess(IGrantable grantee)func GrantFullAccess(Grantee IGrantable) 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.

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal to grant access to.
grantReadData(grantee: IGrantable): Grantdef grant_read_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadData(IGrantable grantee)public Grant GrantReadData(IGrantable grantee)func GrantReadData(Grantee IGrantable) 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.

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal to grant access to.
grantReadWriteData(grantee: IGrantable): Grantdef grant_read_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadWriteData(IGrantable grantee)public Grant GrantReadWriteData(IGrantable grantee)func GrantReadWriteData(Grantee IGrantable) 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.

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal to grant access to.
grantStream(grantee: IGrantable, ...actions: string[]): Grantdef grant_stream(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grantStream(IGrantable grantee, String actions)public Grant GrantStream(IGrantable grantee, string actions)func GrantStream(Grantee IGrantable, Actions *string) Grant#
Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.

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

2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — The principal (no-op if undefined).
  • actionsactionsactionsactionsActions — The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).
grantStreamRead(grantee: IGrantable): Grantdef grant_stream_read(self, grantee: IGrantable) -> Grantpublic Grant grantStreamRead(IGrantable grantee)public Grant GrantStreamRead(IGrantable grantee)func GrantStreamRead(Grantee IGrantable) 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.

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal to grant access to.
grantTableListStreams(grantee: IGrantable): Grantdef grant_table_list_streams(self, grantee: IGrantable) -> Grantpublic Grant grantTableListStreams(IGrantable grantee)public Grant GrantTableListStreams(IGrantable grantee)func GrantTableListStreams(Grantee IGrantable) Grant#
Permits an IAM Principal to list streams attached to current dynamodb table.
1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal (no-op if undefined).
grantWriteData(grantee: IGrantable): Grantdef grant_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantWriteData(IGrantable grantee)public Grant GrantWriteData(IGrantable grantee)func GrantWriteData(Grantee IGrantable) 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.

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — The principal to grant access to.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Metric for the number of Errors executing all Lambdas.
metricConditionalCheckFailedRequests(props?: MetricOptions): Metricdef metric_conditional_check_failed_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConditionalCheckFailedRequests(MetricOptions props)public Metric MetricConditionalCheckFailedRequests(MetricOptions? props = null)func MetricConditionalCheckFailedRequests(Props MetricOptions) Metric#
Metric for the conditional check failed requests.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricConsumedReadCapacityUnits(props?: MetricOptions): Metricdef metric_consumed_read_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedReadCapacityUnits(MetricOptions props)public Metric MetricConsumedReadCapacityUnits(MetricOptions? props = null)func MetricConsumedReadCapacityUnits(Props MetricOptions) Metric#
Metric for the consumed read capacity units.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricConsumedWriteCapacityUnits(props?: MetricOptions): Metricdef metric_consumed_write_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedWriteCapacityUnits(MetricOptions props)public Metric MetricConsumedWriteCapacityUnits(MetricOptions? props = null)func MetricConsumedWriteCapacityUnits(Props MetricOptions) Metric#
Metric for the consumed write capacity units.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricSuccessfulRequestLatency(props?: MetricOptions): Metricdef metric_successful_request_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSuccessfulRequestLatency(MetricOptions props)public Metric MetricSuccessfulRequestLatency(MetricOptions? props = null)func MetricSuccessfulRequestLatency(Props MetricOptions) Metric#
Metric for the successful request latency.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricSystemErrorsForOperations(props?: SystemErrorsForOperationsMetricOptions): IMetricdef metric_system_errors_for_operations(self, props: typing.Optional[SystemErrorsForOperationsMetricOptions] = None) -> IMetricpublic IMetric metricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions props)public IMetric MetricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions? props = null)func MetricSystemErrorsForOperations(Props SystemErrorsForOperationsMetricOptions) IMetric#
Metric for the system errors this table.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricThrottledRequests(props?: MetricOptions): Metricdef metric_throttled_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThrottledRequests(MetricOptions props)public Metric MetricThrottledRequests(MetricOptions? props = null)func MetricThrottledRequests(Props MetricOptions) Metricdeprecated#
use `metricThrottledRequestsForOperations`
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricThrottledRequestsForOperations(props?: OperationsMetricOptions): IMetricdef metric_throttled_requests_for_operations(self, props: typing.Optional[OperationsMetricOptions] = None) -> IMetricpublic IMetric metricThrottledRequestsForOperations(OperationsMetricOptions props)public IMetric MetricThrottledRequestsForOperations(OperationsMetricOptions? props = null)func MetricThrottledRequestsForOperations(Props OperationsMetricOptions) IMetric#
Metric for throttled requests.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
metricUserErrors(props?: MetricOptions): Metricdef metric_user_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricUserErrors(MetricOptions props)public Metric MetricUserErrors(MetricOptions? props = null)func MetricUserErrors(Props MetricOptions) Metric#
Metric for the user errors.
1 parameter

Parameters

  • propspropspropspropsProps — properties of a metric.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) 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.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining