Skip to content

Conversation

@xuxey
Copy link
Contributor

@xuxey xuxey commented Jul 21, 2025

Issue

Related to #33054

Reason for this change

This adds L2 construct support for S3 Tables Namespace and Table resources

Description of changes

These L2 constructs improve the user experience with strong type safety for input properties, more fail-fast validations, and the ability to import existing resources into CDK.

Example Usage

// Build a namespace
const sampleNamespace = new Namespace(scope, 'ExampleNamespace', {
    namespaceName: 'example-namespace-1',
    tableBucket: tableBucket,
});

// Build a table
const sampleTable = new Table(scope, 'ExampleTable', {
    tableName: 'example_table',
    namespace: namespace,
    openTableFormat: OpenTableFormat.ICEBERG,
    withoutMetadata: true,
});

// Build a table with an Iceberg Schema
const sampleTableWithSchema = new Table(scope, 'ExampleSchemaTable', {
    tableName: 'example_table_with_schema',
    namespace: namespace,
    openTableFormat: OpenTableFormat.ICEBERG,
    icebergMetadata: {
        icebergSchema: {
            schemaFieldList: [
            {
                name: 'id',
                type: 'int',
                required: true,
            },
            {
                name: 'name',
                type: 'string',
            },
            ],
        },
    },
    compaction: {
        status: Status.ENABLED,
        targetFileSizeMb: 128,
    },
    snapshotManagement: {
        status: Status.ENABLED,
        maxSnapshotAgeHours: 48,
        minSnapshotsToKeep: 5,
    },
});

Describe any new or updated permissions being added

No permissions are being added with these changes.

Description of how you validated changes

  • Added unit test coverage for new constructs
  • Added integration tests with default and explicit props

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team July 21, 2025 18:42
@github-actions github-actions bot added p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels Jul 21, 2025
Copy link

@hsingh574 hsingh574 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@xuxey xuxey marked this pull request as ready for review July 22, 2025 21:30
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 28, 2025
testCases: [defaultTableTest, schemaTableTest, importedTableTest],
});

integ.node.addDependency(schemaTableTest);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we need this ?
I suppose the IntegTest stack would already depend on the creation of the 3 stacks : defaultTableTest, schemaTableTest, importedTableTest

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting some resource not found errors for the API calls in the integration tests, IIRC adding this fixed that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this ? Were these errors on the assertions below or something else ? (side note : Assertions are deployed as another stack and are deployed post the IntegTest stack has been deployed)

Also SchemaTableStack creates table with a specific schema and compaction setting. Can we have an assertion check on that as well ?

Example : Assertions that check that the table with proper schema and compaction settings are created.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this ? Were these errors on the assertions below or something else ? (side note : Assertions are deployed as another stack and are deployed post the IntegTest stack has been deployed)

Looks like this might be transient error, it works after re-running the integ tests. This gist has the full error message

Also SchemaTableStack creates table with a specific schema and compaction setting. Can we have an assertion check on that as well?

I've added assertions that validate the table maintenance configuration. It may not be feasible to add assertions for schema since we don't have an S3tables API that vends it.

@mergify
Copy link
Contributor

mergify bot commented Jul 30, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 865b3bf
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 30, 2025
@mergify
Copy link
Contributor

mergify bot commented Jul 30, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 576c9ec into aws:main Jul 30, 2025
22 checks passed
@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants