> **Experimental**
>
> `@aws-cdk/aws-s3tables-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# TableBucket

An S3 table bucket with helpers for associated resource policies.

This bucket may not yet have all features that exposed by the underlying CfnTableBucket.

Extends: Construct › Resource › TableBucket
Implements: ITableBucket, IResource, ITaggableV2, IEnvironmentAware, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/table-bucket.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts#L473)
- Type last changed: v2.271.0-alpha.0 · 26 Sep 2026

## Example

```ts
const sampleTableBucket = new TableBucket(scope, 'ExampleTableBucket', {
  tableBucketName: 'example-bucket',
  // Optional fields:
  unreferencedFileRemoval: {
    noncurrentDays: 123,
    status: UnreferencedFileRemovalStatus.ENABLED,
    unreferencedDays: 123,
  },
});
```

## Initializer

```ts
new TableBucket(scope: Construct, id: string, props?: TableBucketProps)
```

## Construct Props

- `account`: string — AWS Account ID of the table bucket owner.

  **Default:** it's assumed the bucket belongs to the same account as the scope it's being imported into

- `encryption`: [TableBucketEncryption](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.TableBucketEncryption.html) — The kind of server-side encryption to apply to this bucket.

  **Default:** `KMS` if `encryptionKey` is specified, or `S3_MANAGED` otherwise.

  If you choose KMS, you can specify a KMS key via `encryptionKey`. If
  encryption key is not specified, a key will automatically be created.

- `encryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — External KMS key to use for bucket encryption.

  **Default:** If `encryption` is set to `KMS` and this property is undefined, a new KMS key will be created and associated with this bucket.

  The `encryption` property must be either not specified or set to `KMS`.
  An error will be emitted if `encryption` is set to `S3_MANAGED`.

- `region`: string — AWS region that the table bucket exists in.

  **Default:** it's assumed the bucket is in the same region as the scope it's being imported into

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RETAIN — Controls what happens to this table bucket it it stoped being managed by cloudformation.

- `requestMetricsStatus`: [RequestMetricsStatus](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.RequestMetricsStatus.html) — CloudWatch request metrics configuration for the table bucket.

  **Default:** Request metrics are disabled

  When enabled, S3 Tables publishes CloudWatch request metrics for the table bucket.
  Request metrics provide insight into Amazon S3 Tables requests.

- `storageClass`: [StorageClass](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.StorageClass.html) — The storage class for the table bucket.

  **Default:** STANDARD storage class

  Determines the storage tier used for table data, allowing optimization
  for different access patterns and cost profiles.

- `tableBucketName`: string — Name of the S3 TableBucket.

  **Default:** generated by CDK from the stack and construct path.

- `unreferencedFileRemoval`: [UnreferencedFileRemoval](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.UnreferencedFileRemoval.html) — Unreferenced file removal settings for the S3 TableBucket.

  **Default:** Enabled with default values

## Properties

- `cdkTagManager`: [TagManager](/cdk/api/v2/docs/aws-cdk-lib.TagManager.html) — The tag manager for this resource.

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

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

- `PROPERTY_INJECTION_ID`: string (static) — Uniquely identifies this class.

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

- `tableBucketArn`: string — The unique Amazon Resource Name (arn) of this table bucket.

- `tableBucketName`: string — The name of this table bucket.

- `tableBucketPolicy`: [TableBucketPolicy](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.TableBucketPolicy.html) — The resource policy for this tableBucket.

## Methods

- `addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult` — Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table bucket and/or its contents. Use `tableBucketArn` and `arnForObjects(keys)` to obtain ARNs for this bucket or objects.

  Note that the policy statement may or may not be added to the policy.
  For example, when an `ITableBucket` is created from an existing table bucket,
  it's not possible to tell whether the bucket already has a policy
  attached, let alone to re-use that policy to add more statements to it.
  So it's safest to do nothing in these cases.

  **Parameters**

  - `statement` — the policy statement to be added to the bucket's policy.

  **Returns:** metadata about the execution of this method. If the policy was not added, the value of `statementAdded` will be `false`. You should always check this value to make sure that the operation was actually carried out. Otherwise, synthesis and deploy will terminate silently, which may be confusing.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — 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**

  - `strength` — - The reference strength to use for this resource.

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

- `fromTableBucketArn(scope: Construct, id: string, tableBucketArn: string): ITableBucket` (static) — Defines a TableBucket construct from an external table bucket ARN.

  **Parameters**

  - `scope` — The parent creating construct (usually `this`).
  - `id` — The construct's name.
  - `tableBucketArn` — Amazon Resource Name (arn) of the table bucket.

- `fromTableBucketAttributes(scope: Construct, id: string, attrs: TableBucketAttributes): ITableBucket` (static) — Defines a TableBucket construct that represents an external table bucket.

  **Parameters**

  - `scope` — The parent creating construct (usually `this`).
  - `id` — The construct's name.
  - `attrs` — A `TableBucketAttributes` object.

- `grantRead(identity: IGrantable, tableId: string): Grant` — [disable-awslint:no-grants].

- `grantReadWrite(identity: IGrantable, tableId: string): Grant` — [disable-awslint:no-grants].

- `grantWrite(identity: IGrantable, tableId: string): Grant` — [disable-awslint:no-grants].

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `validateTableBucketName(bucketName?: string): void` (static) — Throws an exception if the given table bucket name is not valid.

  **Parameters**

  - `bucketName` — name of the bucket.

- `validateUnreferencedFileRemoval(unreferencedFileRemoval?: UnreferencedFileRemoval): void` (static) — Throws an exception if the given unreferencedFileRemovalProperty is not valid.

  **Parameters**

  - `unreferencedFileRemoval` — configuration for the table bucket.

- `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.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
