-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dynamodb): allow setting TableClass for a Table #18719
Conversation
Is everything good ? Any idea on when this feature will be merged ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR - @arjanschaaf! Here's my feedback.
@skinny85, the dynamodb owner, might also take a look as well.
@@ -193,6 +193,12 @@ export interface TableOptions extends SchemaOptions { | |||
*/ | |||
readonly serverSideEncryption?: boolean; | |||
|
|||
/** | |||
* Specifiy the table class. | |||
* @default STANDARD else STANDARD_INFREQUENT_ACCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the else part necessary here?
* @default STANDARD else STANDARD_INFREQUENT_ACCESS | |
* @default STANDARD |
partitionKey: TABLE_PARTITION_KEY, | ||
}); | ||
|
||
Template.fromStack(stack).hasResourceProperties('AWS::DynamoDB::Table', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test, we should also verify that a TableClass
property is not present in the resulting template:
Template.fromStack(stack).hasResourceProperties('AWS::DynamoDB::Table', Match.not(
{
TableClass: Match.anyValue(),
}),
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, however I did implement it slightly different with Match.absent().
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @arjanschaaf, thanks so much for the contribution!
Minor comments, mainly around docs and tests.
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.TableClasses.html | ||
*/ | ||
export enum TableClass { | ||
/** Default table class for DynamoDB */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full-stop please:
/** Default table class for DynamoDB */ | |
/** Default table class for DynamoDB. */ |
test('when specifying STANDARD table class', () => { | ||
const stack = new Stack(); | ||
new Table(stack, CONSTRUCT_NAME, { | ||
tableName: TABLE_NAME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here (we don't need this property).
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @arjanschaaf!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Support already exists in CloudFormation, but hasn't been implemented in CDK. Closes aws#18718 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Support already exists in CloudFormation, but hasn't been implemented in CDK.
Closes #18718
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license