aws / aws/aws-cdk

aws-dynamodb: TableV2 should be called GlobalTable

Open
#28,976 3 comments 22 reactions 0 assignees View on GitHub
@aws-cdk/aws-dynamodb effort/medium feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The `TableV2` construct should be named `GlobalTable` to provide a clear mapping to the underlying CloudFormation construct and avoid customer confusion around why it behaves differently.

### Use Case

The construct is confusingly named, and breaks customer expectations. Based on the name, one would have reason to expect it to create a `AWS::DynamoDB::Table` resource, when it creates `AWS::DynamoDB::GlobalTable` resources. This is _especially_ confusing because it is not mentioned at all in [the documentation for the construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableV2.html).

This has already caused customer confusion, as reported in #27378 and #27443. The answers to those issues did not help clarify the situation, as both answers simply reported that the CDK construct didn't support the desired behavior, but failed to fully explain why. The only mention of the difference is in [a blog post](https://aws.amazon.com/blogs/devops/a-new-and-improved-aws-cdk-construct-for-amazon-dynamodb-tables/).

### Proposed Solution

* Rename `TableV2` to `GlobalTable`.
* Create a new `TableV2` that forwards to `GlobalTable` and is marked deprecated, to prompt customers to use the new name.

### Other Information

_No response_

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.87.0

### Environment details (OS name and version, etc.)

macOS 14.3

Contributor guide

Open the contributing guide

Research direction

Start at the aws_dynamodb.TableV2 construct entry point and trace its public export and construct documentation. Done means GlobalTable is the primary name, TableV2 forwards to it with a deprecation notice, and the documentation explains the mapping to AWS::DynamoDB::GlobalTable.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.