Skip to content

revert: (dynamodb) revert Table.table field to private to fix .NET naming#36029

Merged
mergify[bot] merged 3 commits intoaws:mainfrom
pahud:fix-36025-dynamodb-table-net-naming
Nov 13, 2025
Merged

revert: (dynamodb) revert Table.table field to private to fix .NET naming#36029
mergify[bot] merged 3 commits intoaws:mainfrom
pahud:fix-36025-dynamodb-table-net-naming

Conversation

@pahud
Copy link
Copy Markdown
Contributor

@pahud pahud commented Nov 12, 2025

Issue # (if applicable)

Closes #36025.

Reason for this change

The Table class in aws-dynamodb was incorrectly renamed to Table_ in .NET bindings starting from v2.222.0, breaking all .NET CDK applications using DynamoDB tables. This regression was introduced in PR #35554 when the internal table field was changed from private to protected, creating a JSII naming conflict in .NET where property names cannot match class names.

Description of changes

This PR reverts the table field visibility from protected back to private at line 1213 in packages/aws-cdk-lib/aws-dynamodb/lib/table.ts.

Technical details:

  • Changed protected readonly table: CfnTable; to private readonly table: CfnTable;
  • This is a single-line change that resolves the JSII naming conflict
  • The field is only used internally within the Table class (7 internal usages verified)
  • No subclasses of Table exist in the codebase
  • JSII compilation now succeeds without renaming the Table class in .NET

Impact:

  • Fixes .NET class name from Table_ back to Table
  • Restores v2.221.1 behavior
  • No impact on TypeScript, Python, Java, or Go bindings
  • No functional or API changes
  • Better encapsulation by keeping internal implementation details private

Description of how you validated changes

  • Unit tests: All 348 existing unit tests in aws-dynamodb pass without modification
    • Test suites: 6 passed
    • Tests: 348 passed, 0 failed
  • Build validation:
    • TypeScript compilation: SUCCESS
  • JSII verification: Confirmed no JSII warnings for Table class in build output, indicating .NET bindings will use correct class name
 % npx lerna run build --scope=aws-cdk-lib --skip-nx-cache
 2>&1 | grep -i "table" | grep -i "warning\|conflict\|rename"

Checklist


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

…o private

- Modify `table` property in `Table` class to be private instead of protected
- Ensures better encapsulation of internal implementation details
- Prevents direct external modification of the underlying CloudFormation table resource
@github-actions github-actions bot added bug This issue is a bug. p1 labels Nov 12, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 12, 2025 14:01
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 12, 2025
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@pahud pahud marked this pull request as ready for review November 12, 2025 14:12
@pahud pahud changed the title fix(dynamodb): revert Table.table field to private to fix .NET naming revert: (dynamodb) revert Table.table field to private to fix .NET naming Nov 12, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 12, 2025 14:15

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

- Remove `table` property from `aws-cdk-lib.aws_dynamodb.Table`
- Update allowed breaking changes documentation
- Simplify public interface for DynamoDB Table construct
@leonmk-aws leonmk-aws self-assigned this Nov 12, 2025
@ozelalisen
Copy link
Copy Markdown
Member

@Mergifyio requeue

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 13, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 13, 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
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 13, 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 d84fce8 into aws:main Nov 13, 2025
18 of 19 checks passed
@github-actions
Copy link
Copy Markdown
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 Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. p1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamodb: breaking change in .NET, resource renamed Table -> Table_

4 participants