Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/@aws-cdk/aws-s3tables-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,38 @@ const tableBucketWithMetrics = new TableBucket(scope, 'TableBucketWithMetrics',
});
```

### Configuring Storage Class

You can configure the storage class for your table bucket and tables. Storage class determines how data is stored and billed, allowing you to optimize for different access patterns.

```ts
// Create a table bucket with INTELLIGENT_TIERING storage class
const tableBucketWithStorageClass = new TableBucket(scope, 'TableBucketWithStorageClass', {
tableBucketName: 'storage-class-bucket',
storageClass: StorageClass.INTELLIGENT_TIERING,
});
```

Tables inherit the storage class from their parent bucket by default. You can also override the storage class at the table level:

```ts
// Create a table with explicit storage class (overrides bucket default)
const tableWithStorageClass = new Table(scope, 'TableWithStorageClass', {
tableName: 'storage_class_table',
namespace: namespace,
openTableFormat: OpenTableFormat.ICEBERG,
withoutMetadata: true,
storageClass: StorageClass.STANDARD,
});
```

Available storage classes:

- `StorageClass.STANDARD` - For frequently accessed data
- `StorageClass.INTELLIGENT_TIERING` - Automatically moves data between access tiers based on usage patterns

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

### Controlling Table Permissions

```ts
Expand Down
35 changes: 34 additions & 1 deletion packages/@aws-cdk/aws-s3tables-alpha/lib/table-bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,29 @@ export enum RequestMetricsStatus {
DISABLED = 'Disabled',
}

/**
* Storage class for S3 Tables.
*
* Determines the storage tier used for table data, allowing optimization
* for different access patterns and cost profiles.
*/
export enum StorageClass {
/**
* Standard storage class for frequently accessed data.
*
* Use this for tables with consistent, high-frequency access patterns.
*/
STANDARD = 'STANDARD',

/**
* Intelligent-Tiering storage class that automatically moves data between access tiers.
*
* Use this for tables with unknown or changing access patterns to optimize costs
* while maintaining performance for frequently accessed data.
*/
INTELLIGENT_TIERING = 'INTELLIGENT_TIERING',
}

/**
* Controls Server Side Encryption (SSE) for this TableBucket.
*/
Expand Down Expand Up @@ -374,6 +397,16 @@ export interface TableBucketProps {
* @default - Request metrics are disabled
*/
readonly requestMetricsStatus?: RequestMetricsStatus;

/**
* The storage class for the table bucket.
*
* Determines the storage tier used for table data, allowing optimization
* for different access patterns and cost profiles.
*
* @default - STANDARD storage class
*/
readonly storageClass?: StorageClass;
}

/**
Expand Down Expand Up @@ -632,6 +665,7 @@ export class TableBucket extends TableBucketBase implements ITaggableV2 {
},
encryptionConfiguration: bucketEncryption,
metricsConfiguration: props.requestMetricsStatus ? { status: props.requestMetricsStatus } : undefined,
storageClassConfiguration: props.storageClass ? { storageClass: props.storageClass } : undefined,
});

this.cdkTagManager = this.resource.cdkTagManager;
Expand Down Expand Up @@ -749,4 +783,3 @@ export class TableBucket extends TableBucketBase implements ITaggableV2 {
}));
}
}

14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-s3tables-alpha/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
import type { Construct } from 'constructs';
import type { INamespace } from './namespace';
import * as perms from './permissions';
import type { StorageClass } from './table-bucket';

/**
* Represents an S3 Table.
Expand Down Expand Up @@ -240,6 +241,18 @@ export interface TableProps {
* @default false
*/
readonly withoutMetadata?: boolean;

/**
* The storage class for the table.
*
* 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.
*
* @default - Inherits from the table bucket's storage class configuration
*/
readonly storageClass?: StorageClass;
}

/**
Expand Down Expand Up @@ -787,6 +800,7 @@ export class Table extends TableBase implements ITaggableV2 {
icebergMetadata: this.buildIcebergMetadata(props.icebergMetadata),
snapshotManagement: props.snapshotManagement,
withoutMetadata: props.withoutMetadata ? 'Yes' : undefined,
storageClassConfiguration: props.storageClass ? { storageClass: props.storageClass } : undefined,
});

this.namespace = props.namespace;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Construct } from 'constructs';
import { Stack, Tags } from 'aws-cdk-lib';
import { TableBucket, UnreferencedFileRemovalStatus, TableBucketEncryption, RequestMetricsStatus, Namespace, Table, Status, OpenTableFormat, IcebergTransform, SortDirection, NullOrder } from '@aws-cdk/aws-s3tables-alpha';
import { TableBucket, UnreferencedFileRemovalStatus, TableBucketEncryption, RequestMetricsStatus, StorageClass, Namespace, Table, Status, OpenTableFormat, IcebergTransform, SortDirection, NullOrder } from '@aws-cdk/aws-s3tables-alpha';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as kms from 'aws-cdk-lib/aws-kms';

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"Resources": {
"DefaultBucket62385A75": {
"Type": "AWS::S3Tables::TableBucket",
"Properties": {
"TableBucketName": "sc-default-integ-test",
"UnreferencedFileRemoval": {}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"DefaultNamespaceD1A02467": {
"Type": "AWS::S3Tables::Namespace",
"Properties": {
"Namespace": "default_ns",
"TableBucketARN": {
"Fn::GetAtt": [
"DefaultBucket62385A75",
"TableBucketARN"
]
}
},
"DependsOn": [
"DefaultBucket62385A75"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"DefaultTable0A5768B5": {
"Type": "AWS::S3Tables::Table",
"Properties": {
"Namespace": "default_ns",
"OpenTableFormat": "ICEBERG",
"TableBucketARN": {
"Fn::GetAtt": [
"DefaultBucket62385A75",
"TableBucketARN"
]
},
"TableName": "default_table",
"WithoutMetadata": "Yes"
},
"DependsOn": [
"DefaultNamespaceD1A02467"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading