# S3TableStorage

Where an `S3Table` stores its data.

The two paths are mutually exclusive: a managed bucket may specify its
server-side encryption, while an existing bucket keeps its own encryption — so
an encryption choice can never be paired with a bring-your-own bucket.

- Source: [`aws-glue/lib/s3-table.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-glue/lib/s3-table.ts#L67)
- Type last changed: v2.270.0 · 17 Sep 2026

## Example

```ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
  storage: glue.S3TableStorage.managedBucket(glue.S3TableEncryption.s3Managed()),
  // ...
  database: myDatabase,
  columns: [{
    name: 'col1',
    type: glue.Schema.STRING,
  }],
  dataFormat: glue.DataFormat.JSON,
});
```

## Methods

- `fromBucket(bucket: IBucket): S3TableStorage // chainable` (static) — Store the table's data in an existing bucket. CDK does not manage the bucket's encryption.

  The bucket can be one you don't own, imported with
  `Bucket.fromBucketArn()` or `Bucket.fromBucketAttributes()`. If that bucket
  is KMS-encrypted, import it with `Bucket.fromBucketAttributes()` and supply
  the `encryptionKey` attribute. Otherwise, CDK has no reference to the key,
  which means that `S3Table.grantRead()`/`grantWrite()` will correctly grant
  S3 access but silently skip the KMS permissions on the key. As a consequence,
  at runtime, reads and writes will fail with access denied on the key.

  **Parameters**

  - `bucket` — the bucket that holds the table's data.

- `managedBucket(encryption?: S3TableEncryption): S3TableStorage // chainable` (static) — Store the table's data in a bucket created and managed by the table.

  **Parameters**

  - `encryption` — the server-side encryption for the created bucket.
