Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LeeroyHannigan
Copy link
Contributor

Issue # (if applicable)

Closes #32786

Reason for this change

New feature of DynamoDB

Description of changes

Added pointInTimeRecoverySpecification which takes pointInTimeRecoveryEnabled and recoveryPeriodInDays.

Deprecated pointInTimeRecovery as it could not take recoveryPeriodInDays

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

@aws-cdk-automation aws-cdk-automation requested a review from a team January 22, 2025 13:41
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.57%. Comparing base (f58f80f) to head (d95990f).
Report is 23 commits behind head on main.

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              
Flag Coverage Δ
suite.unit 81.57% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 80.99% <ø> (+0.05%) ⬆️
packages/aws-cdk-lib/core 82.17% <ø> (+0.02%) ⬆️

@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 Jan 23, 2025
@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 Jan 23, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Comment on lines +715 to +720
const pointInTimeRecoverySpecification: PointInTimeRecoverySpecification | undefined =
props.pointInTimeRecoverySpecification ??
this.tableOptions.pointInTimeRecoverySpecification ??
(pointInTimeRecovery !== undefined
? { pointInTimeRecoveryEnabled: pointInTimeRecovery }
: undefined);
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.');
Copy link
Contributor

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.');
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. 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.

(dynamodb): pitr retention period configuration
4 participants