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

An S3 Table with helpers.

Extends: Construct › Resource › Table
Implements: ITable, IResource, ITaggableV2, IEnvironmentAware, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/table.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-s3tables-alpha/lib/table.ts#L652)

## Example

```ts
// Build a table with partition spec (minimal configuration)
const partitionedTable = new Table(scope, 'PartitionedTable', {
    tableName: 'partitioned_table',
    namespace: namespace,
    openTableFormat: OpenTableFormat.ICEBERG,
    icebergMetadata: {
        icebergSchema: {
            schemaFieldList: [
                { name: 'event_date', type: 'date', required: true },
                { name: 'event_name', type: 'string' },
            ],
        },
        icebergPartitionSpec: {
            fields: [
                {
                    sourceId: 1,
                    transform: IcebergTransform.IDENTITY,
                    name: 'date_partition',
                },
            ],
        },
    },
});
```

## Initializer

```ts
new Table(scope: Construct, id: string, props: TableProps)
```

## Construct Props

- `compaction`: [CompactionProperty](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.CompactionProperty.html) — Settings governing the Compaction maintenance action.

  **Default:** Amazon S3 selects the best compaction strategy based on your table sort order.

- `icebergMetadata`: [IcebergMetadataProperty](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.IcebergMetadataProperty.html) — Contains details about the metadata for an Iceberg table.

  **Default:** table is created without any metadata

- `namespace`: [INamespace](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.INamespace.html) (required) — The namespace under which this table is created.

- `openTableFormat`: [OpenTableFormat](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.OpenTableFormat.html) (required) — Format of this table.

  Currently, the only supported value is OpenTableFormat.ICEBERG.

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

- `snapshotManagement`: [SnapshotManagementProperty](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.SnapshotManagementProperty.html) — Contains details about the snapshot management settings for an Iceberg table.

  **Default:** enabled: MinimumSnapshots is 1 by default and MaximumSnapshotAge is 120 hours by default.

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

  **Default:** Inherits from the table bucket's storage class configuration

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

  Note: This is a create-only property and cannot be changed after the table is created.

- `tableName`: string (required) — Name of this table, unique within the namespace.

- `withoutMetadata`: boolean = false — If true, indicates that you don't want to specify a schema for the table.

  This property is mutually exclusive to 'IcebergMetadata'.

## Properties

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

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

- `namespace`: [INamespace](/cdk/api/v2/docs/@aws-cdk_aws-s3tables-alpha.INamespace.html) — The namespace containing this table.

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

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

- `tableName`: string — The name of this table.

- `tablePolicy`: [CfnTablePolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_s3tables.CfnTablePolicy.html) — The resource policy for this table.

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

  Note that the policy statement may or may not be added to the policy.
  For example, when an `ITable` is created from an existing table,
  it's not possible to tell whether the table 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.

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

- `fromTableAttributes(scope: Construct, id: string, attrs: TableAttributes): ITable` (static) — Defines a Table construct that represents an external table.

  **Parameters**

  - `scope` — The parent creating construct (usually `this`).
  - `id` — The construct's name.
  - `attrs` — A `TableAttributes` object containing the table name and ARN.

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

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

- `grantWrite(identity: IGrantable): 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.

- `validateTableName(tableName: string): void` (static) — See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html.

  **Parameters**

  - `tableName` — Name of the table.

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