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 4 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.52%. Comparing base (f58f80f) to head (2b4c5c8).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33059   +/-   ##
=======================================
  Coverage   81.52%   81.52%           
=======================================
  Files         224      224           
  Lines       13762    13762           
  Branches     2414     2414           
=======================================
  Hits        11220    11220           
  Misses       2270     2270           
  Partials      272      272           
Flag Coverage Δ
suite.unit 81.52% <ø> (ø)

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

Components Coverage Δ
packages/aws-cdk 80.93% <ø> (ø)
packages/aws-cdk-lib/core 82.15% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@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
*
* @default - point in time recovery is not enabled.
*/
readonly pointInTimeRecoverySpecification?: PointInTimeRecoverySpecification;
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 pointInTimeRecoverySpecification?: PointInTimeRecoverySpecification;
readonly pointInTimeRecoveryPeriod?: Duration;

We should follow the design guidelines and provide a flat interface:

  1. We can avoid deprecating the pointInTimeRecovery property and build the PointInTimeRecoverySpecification CFN prop accordingly.
  2. We should validate that pointInTimeRecoveryPeriod is between 1 and 35 days, and defaults to 35 (docs).
  3. We should error if pointInTimeRecovery is explicitly set to false and pointInTimeRecoveryPeriod is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review.

  1. I've discussed with the team on the continuation of extra fields for DynamoDB and this if we continue to utilize a flat interface we would have a very long list of parameters.
  2. Do we need this validation, as CFN validates this for us and will throw the appropriate exception?
  3. Same as above?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @lpizzinidev for the detailed review.

  1. I had discussions with Lee on the design. While the design guidelines advocate for flattening nested properties to accommodate languages like Java, given that TypeScript and Python users account for approximately 95% of all CDK users, it might be worth revisiting this guideline with the team.
    In my view, flattening properties introduces unnecessary noise by adding all options to the top-level namespace, making it harder for users to identify the right property. For TypeScript and Python users, nested structures are not only idiomatic but also provide better organization and ease of use programmatically.

  2. For validation, it's an ongoing debate as well within the CDK team as some thinks we should leave the validation to CFN side in case if the rules change and CDK will need to make code changes to account for it (and often we won't be notified immediately) while some thinks validation on CDK side can help raise the error faster without deploying the template. IMO, I prefer to do the validation as well so I agree with you on this point.

  3. I agree with you for the above reason.

@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
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