# ITable

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

Extends: ITable
Extends: IResource, ITableRef
Implemented by: Table, TableBase, TableBaseV2, TableV2, TableV2MultiAccountReplica

- Source: [`aws-dynamodb/lib/shared.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-dynamodb/lib/shared.ts#L363)
- Type last changed: v2.234.0 · 8 Jan 2026

## Properties

- `encryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — Optional KMS encryption key associated with this table.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — 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.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

- `tableArn`: string (required) — Arn of the dynamodb table.

- `tableName`: string (required) — Table name of the dynamodb table.

- `tableRef`: [TableReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_dynamodb.TableReference.html) (required) — A reference to a Table resource.

- `tableStreamArn`: string — ARN of the table's stream, if there is one.

## Methods

- `applyRemovalPolicy(policy: RemovalPolicy): void` — 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`).

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

  **Parameters**

  - `grantee` — The principal (no-op if undefined).
  - `actions` — The set of actions to allow (i.e. "dynamodb:PutItem", "dynamodb:GetItem", ...).

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

  **Parameters**

  - `grantee` — The principal to grant access to.

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

  **Parameters**

  - `grantee` — The principal to grant access to.

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

  **Parameters**

  - `grantee` — The principal to grant access to.

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

  **Parameters**

  - `grantee` — The principal (no-op if undefined).
  - `actions` — The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).

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

  **Parameters**

  - `grantee` — The principal to grant access to.

- `grantTableListStreams(grantee: IGrantable): Grant` — Permits an IAM Principal to list streams attached to current dynamodb table.

  **Parameters**

  - `grantee` — The principal (no-op if undefined).

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

  **Parameters**

  - `grantee` — The principal to grant access to.

- `metric(metricName: string, props?: MetricOptions): Metric` — Metric for the number of Errors executing all Lambdas.

- `metricConditionalCheckFailedRequests(props?: MetricOptions): Metric` — Metric for the conditional check failed requests.

  **Parameters**

  - `props` — properties of a metric.

- `metricConsumedReadCapacityUnits(props?: MetricOptions): Metric` — Metric for the consumed read capacity units.

  **Parameters**

  - `props` — properties of a metric.

- `metricConsumedWriteCapacityUnits(props?: MetricOptions): Metric` — Metric for the consumed write capacity units.

  **Parameters**

  - `props` — properties of a metric.

- `metricSuccessfulRequestLatency(props?: MetricOptions): Metric` — Metric for the successful request latency.

  **Parameters**

  - `props` — properties of a metric.

- `metricSystemErrorsForOperations(props?: SystemErrorsForOperationsMetricOptions): IMetric` — Metric for the system errors this table.

  **Parameters**

  - `props` — properties of a metric.

- `metricThrottledRequests(props?: MetricOptions): Metric` — use `metricThrottledRequestsForOperations`

  **Parameters**

  - `props` — properties of a metric.

- `metricThrottledRequestsForOperations(props?: OperationsMetricOptions): IMetric` — Metric for throttled requests.

  **Parameters**

  - `props` — properties of a metric.

- `metricUserErrors(props?: MetricOptions): Metric` — Metric for the user errors.

  **Parameters**

  - `props` — properties of a metric.

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

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
