# S3TableProps

Extends: [TableBaseProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.TableBaseProps.html)
Used as props by: [S3Table](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.S3Table.html)

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

## Example

TypeScript:

```ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
  database: myDatabase,
  columns: [{
    name: 'data',
    type: glue.Schema.STRING,
  }],
  partitionKeys: [{
    name: 'date',
    type: glue.Schema.STRING,
  }],
  dataFormat: glue.DataFormat.JSON,
  partitionProjection: {
    date: glue.PartitionProjectionConfiguration.date({
      min: 'NOW-3YEARS',
      max: 'NOW',
      format: 'yyyy-MM-dd',
    }),
  },
});
```

Python:

```python
# my_database: glue.Database

glue.S3Table(self, "MyTable",
    database=my_database,
    columns=[glue.Column(
        name="data",
        type=glue.Schema.STRING
    )],
    partition_keys=[glue.Column(
        name="date",
        type=glue.Schema.STRING
    )],
    data_format=glue.DataFormat.JSON,
    partition_projection={
        "date": glue.PartitionProjectionConfiguration.date(
            min="NOW-3YEARS",
            max="NOW",
            format="yyyy-MM-dd"
        )
    }
)
```

Java:

```java
Database myDatabase;

S3Table.Builder.create(this, "MyTable")
        .database(myDatabase)
        .columns(List.of(Column.builder()
                .name("data")
                .type(Schema.STRING)
                .build()))
        .partitionKeys(List.of(Column.builder()
                .name("date")
                .type(Schema.STRING)
                .build()))
        .dataFormat(DataFormat.JSON)
        .partitionProjection(Map.of(
                "date", PartitionProjectionConfiguration.date(DatePartitionProjectionConfigurationProps.builder()
                        .min("NOW-3YEARS")
                        .max("NOW")
                        .format("yyyy-MM-dd")
                        .build())))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Database myDatabase;

new S3Table(this, "MyTable", new S3TableProps {
    Database = myDatabase,
    Columns = new [] { new Column {
        Name = "data",
        Type = Schema.STRING
    } },
    PartitionKeys = new [] { new Column {
        Name = "date",
        Type = Schema.STRING
    } },
    DataFormat = DataFormat.JSON,
    PartitionProjection = new Dictionary<string, PartitionProjectionConfiguration> {
        { "date", PartitionProjectionConfiguration.Date(new DatePartitionProjectionConfigurationProps {
            Min = "NOW-3YEARS",
            Max = "NOW",
            Format = "yyyy-MM-dd"
        }) }
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myDatabase Database

glue.NewS3Table(this, jsii.String("MyTable"), &S3TableProps{
	Database: myDatabase,
	Columns: []Column{
		&Column{
			Name: jsii.String("data"),
			Type: glue.Schema_STRING(),
		},
	},
	PartitionKeys: []Column{
		&Column{
			Name: jsii.String("date"),
			Type: glue.Schema_STRING(),
		},
	},
	DataFormat: glue.DataFormat_JSON(),
	PartitionProjection: map[string]PartitionProjectionConfiguration{
		"date": glue.PartitionProjectionConfiguration_date(&DatePartitionProjectionConfigurationProps{
			"min": jsii.String("NOW-3YEARS"),
			"max": jsii.String("NOW"),
			"format": jsii.String("yyyy-MM-dd"),
		}),
	},
})
```

## Properties

- `clientSideEncryption`: [TableClientSideEncryption](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.TableClientSideEncryption.html) — Client-side encryption (CSE-KMS) for the table's data.

  **Default:** no client-side encryption

  Independent of the bucket's server-side encryption, and valid whether the
  bucket is managed or provided.

- `columns`: [Column](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Column.html)[] (required) — Columns of the table.

- `compressed`: boolean = false — Indicates whether the table's data is compressed or not.

- `database`: [IDatabase](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.IDatabase.html) (required) — Database in which to store the table.

- `dataFormat`: [DataFormat](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.DataFormat.html) (required) — Storage type of the table's data.

- `description`: string = generated — Description of the table.

- `enablePartitionFiltering`: boolean — Enables partition filtering.

  **Default:** The parameter is not defined

- `hasEncryptedData`: boolean = true — Whether the data stored in the table is encrypted.

  This sets the `has_encrypted_data` table parameter. Athena reads it when
  querying client-side (CSE-KMS) encrypted datasets; for server-side
  encrypted (SSE-S3 / SSE-KMS) or unencrypted data it has no effect, since
  Amazon S3 decrypts server-side encrypted objects transparently.

  Do not also set `has_encrypted_data` through `parameters` - use this
  property instead. A conflicting value in `parameters` is rejected.

- `parameters`: { [key: string]: string } — The key/value pairs define properties associated with the table.

  **Default:** The parameter is not defined

  The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

- `partitionIndexes`: [PartitionIndex](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.PartitionIndex.html)[] — Partition indexes on the table.

  **Default:** table has no partition indexes

  A maximum of 3 indexes
  are allowed on a table. Keys in the index must be part
  of the table's partition keys.

- `partitionKeys`: [Column](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.Column.html)[] — Partition columns of the table.

  **Default:** table is not partitioned

- `partitionProjection`: { [key: string]: [PartitionProjectionConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.PartitionProjectionConfiguration.html) } — Partition projection configuration for this table.

  **Default:** No partition projection

  Partition projection allows Athena to automatically add new partitions
  without requiring `ALTER TABLE ADD PARTITION` statements.

- `s3Prefix`: string — S3 prefix under which table objects are stored.

  **Default:** No prefix. The data will be stored under the root of the bucket.

  When the table shares a bucket with other tables or consumers, set this so
  that the `grant*` methods scope S3 access to this table's data. Without a
  prefix, those grants cover the entire bucket.

- `storage`: [S3TableStorage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.S3TableStorage.html) — Where the table's data is stored: a bucket created and managed by the table, or an existing bucket you provide.

  **Default:** a managed bucket with S3-managed (SSE-S3) encryption

- `storageParameters`: [StorageParameter](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.StorageParameter.html)[] — The user-supplied properties for the description of the physical storage of this table.

  **Default:** The parameter is not defined

  These properties help describe the format of the data that is stored within the crawled data sources.

  The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

  Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.

  ```ts
     declare const glueDatabase: glue.IDatabase;
     const table = new glue.S3Table(this, 'Table', {
       storageParameters: [
           glue.StorageParameter.skipHeaderLineCount(1),
           glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
           glue.StorageParameter.custom('foo', 'bar'), // Will have no effect
           glue.StorageParameter.custom('separatorChar', ','), // Will describe the separator char used in the data
           glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, 'off'),
       ],
       // ...
       database: glueDatabase,
       columns: [{
           name: 'col1',
           type: glue.Schema.STRING,
       }],
       dataFormat: glue.DataFormat.CSV,
     });
  ```

- `storedAsSubDirectories`: boolean = false — Indicates whether the table data is stored in subdirectories.

- `tableName`: string — Name of the table.

  **Default:** generated by CDK.
