-
Notifications
You must be signed in to change notification settings - Fork 4k
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): add pointintimerecoveryspecification and deprecate old #33059
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33059 +/- ##
==========================================
+ Coverage 81.52% 81.57% +0.04%
==========================================
Files 224 227 +3
Lines 13762 13793 +31
Branches 2414 2419 +5
==========================================
+ Hits 11220 11251 +31
Misses 2270 2270
Partials 272 272
Flags with carried forward coverage won't be shown. Click here to find out more.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
const pointInTimeRecoverySpecification: PointInTimeRecoverySpecification | undefined = | ||
props.pointInTimeRecoverySpecification ?? | ||
this.tableOptions.pointInTimeRecoverySpecification ?? | ||
(pointInTimeRecovery !== undefined | ||
? { pointInTimeRecoveryEnabled: pointInTimeRecovery } | ||
: undefined); |
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.
A comment above this logic will be appreciated.
* If no value is provided, the value will default to 35. | ||
* @default 35 | ||
*/ | ||
readonly recoveryPeriodInDays?: number; |
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.
readonly recoveryPeriodInDays?: number; | |
readonly recoveryPeriodInDays?: Duration; |
const recoveryPeriodInDays = props.pointInTimeRecoverySpecification?.recoveryPeriodInDays; | ||
|
||
if (props.pointInTimeRecovery !== undefined && props.pointInTimeRecoverySpecification !== undefined) { | ||
throw new Error('`pointInTimeRecoverySpecification` and `pointInTimeRecovery` are set. Use `pointInTimeRecoverySpecification` only.'); |
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.
We're replacing any validation error from new Error
to new ValidationError
. Can you stick to the new validation error please?
private validatePitr (props: TableProps): PointInTimeRecoverySpecification | undefined { | ||
|
||
if (props.pointInTimeRecoverySpecification !==undefined && props.pointInTimeRecovery !== undefined) { | ||
throw new Error('`pointInTimeRecoverySpecification` and `pointInTimeRecovery` are set. Use `pointInTimeRecoverySpecification` only.'); |
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 here, please use ValidationError
Issue # (if applicable)
Closes #32786
Reason for this change
New feature of DynamoDB
Description of changes
Added
pointInTimeRecoverySpecification
which takespointInTimeRecoveryEnabled
andrecoveryPeriodInDays
.Deprecated
pointInTimeRecovery
as it could not takerecoveryPeriodInDays
Describe any new or updated permissions being added
Description of how you validated changes
Integ and Unit tests
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license