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

(aws-rds): props validation for new DB cluster should include all validation errors at once #32840

Closed
1 of 2 tasks
iankhou opened this issue Jan 10, 2025 · 2 comments · Fixed by #32841
Closed
1 of 2 tasks
Assignees
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@iankhou
Copy link
Contributor

iankhou commented Jan 10, 2025

Describe the feature

The user will be notified of all props validation issues when attempting to initialize an RDS DB Cluster instance. The current implementation fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

Use Case

It will be frustrating for users when they have multiple props validation issues, but have to fix them one at a time.

Proposed Solution

Instead of failing fast at the first validation error, complete the validation checks and present the user with all problems that need to be fixed.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.174.1 (build f353fc7)

Environment details (OS name and version, etc.)

MacOS Sequoia 15.2 (24C101)

@iankhou iankhou added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. @aws-cdk/aws-rds Related to Amazon Relational Database labels Jan 10, 2025
@iankhou iankhou self-assigned this Jan 10, 2025
@iankhou iankhou removed the needs-triage This issue or PR still needs to be triaged. label Jan 10, 2025
@khushail khushail added p2 effort/small Small work item – less than a day of effort labels Jan 10, 2025
@mergify mergify bot closed this as completed in #32841 Jan 23, 2025
@mergify mergify bot closed this as completed in 344d916 Jan 23, 2025
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2025
moelasmar pushed a commit that referenced this issue Jan 24, 2025
…rops (#32841)

### Issue #32840

Closes #32840

### Reason for this change

When initializing a new RDS DB Cluster, the [current implementation](https://github.com/aws/aws-cdk/pull/32151/files#diff-49b4a9e1bf0b7db3ab71f4f08580da0cb2191d84605dc82a70c324bd122d5cf7R805-R828) fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

### Description of changes

Implemented a [validation function](https://github.com/aws/aws-cdk/pull/32841/files#diff-5d08d37e744e173239879212c59fd45cb9a279349f3dfb1c66923cb015ed3a3a) that collects all validation errors and presents them to the user. Used this function in RDS Database Cluster initialization. I will implement this separately for SQS Queue initialization as a POC for usability.

There are several other places that can make use of this shared code, to show users all validation errors at once. Here's a non-exhaustive list:
- [aws-ec2](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L672-L743)
- [eventbridge-scheduler](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eventbridge-scheduler/create-schedule.ts#L324-L362)
- [aws-fsx](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-fsx/lib/lustre-file-system.ts#L360-L380)

### Describe any new or updated permissions being added

No permissions changes.

### Description of how you validated changes

Added unit tests and modified existing unit tests.

<img width="698" alt="Screenshot 2025-01-16 at 14 51 47" src="https://github.com/user-attachments/assets/a724a16a-7ccc-43b6-8fee-599ec007566d" />

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

(cherry picked from commit 344d916)
moelasmar pushed a commit that referenced this issue Jan 24, 2025
…rops (#32841)

### Issue #32840

Closes #32840

### Reason for this change

When initializing a new RDS DB Cluster, the [current implementation](https://github.com/aws/aws-cdk/pull/32151/files#diff-49b4a9e1bf0b7db3ab71f4f08580da0cb2191d84605dc82a70c324bd122d5cf7R805-R828) fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

### Description of changes

Implemented a [validation function](https://github.com/aws/aws-cdk/pull/32841/files#diff-5d08d37e744e173239879212c59fd45cb9a279349f3dfb1c66923cb015ed3a3a) that collects all validation errors and presents them to the user. Used this function in RDS Database Cluster initialization. I will implement this separately for SQS Queue initialization as a POC for usability.

There are several other places that can make use of this shared code, to show users all validation errors at once. Here's a non-exhaustive list:
- [aws-ec2](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L672-L743)
- [eventbridge-scheduler](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eventbridge-scheduler/create-schedule.ts#L324-L362)
- [aws-fsx](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-fsx/lib/lustre-file-system.ts#L360-L380)

### Describe any new or updated permissions being added

No permissions changes.

### Description of how you validated changes

Added unit tests and modified existing unit tests.

<img width="698" alt="Screenshot 2025-01-16 at 14 51 47" src="https://github.com/user-attachments/assets/a724a16a-7ccc-43b6-8fee-599ec007566d" />

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

(cherry picked from commit 344d916)
moelasmar pushed a commit that referenced this issue Jan 24, 2025
…rops (#32841)

### Issue #32840

Closes #32840

### Reason for this change

When initializing a new RDS DB Cluster, the [current implementation](https://github.com/aws/aws-cdk/pull/32151/files#diff-49b4a9e1bf0b7db3ab71f4f08580da0cb2191d84605dc82a70c324bd122d5cf7R805-R828) fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

### Description of changes

Implemented a [validation function](https://github.com/aws/aws-cdk/pull/32841/files#diff-5d08d37e744e173239879212c59fd45cb9a279349f3dfb1c66923cb015ed3a3a) that collects all validation errors and presents them to the user. Used this function in RDS Database Cluster initialization. I will implement this separately for SQS Queue initialization as a POC for usability.

There are several other places that can make use of this shared code, to show users all validation errors at once. Here's a non-exhaustive list:
- [aws-ec2](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L672-L743)
- [eventbridge-scheduler](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eventbridge-scheduler/create-schedule.ts#L324-L362)
- [aws-fsx](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-fsx/lib/lustre-file-system.ts#L360-L380)

### Describe any new or updated permissions being added

No permissions changes.

### Description of how you validated changes

Added unit tests and modified existing unit tests.

<img width="698" alt="Screenshot 2025-01-16 at 14 51 47" src="https://github.com/user-attachments/assets/a724a16a-7ccc-43b6-8fee-599ec007566d" />

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

(cherry picked from commit 344d916)
moelasmar pushed a commit that referenced this issue Jan 24, 2025
…rops (#32841)

### Issue #32840

Closes #32840

### Reason for this change

When initializing a new RDS DB Cluster, the [current implementation](https://github.com/aws/aws-cdk/pull/32151/files#diff-49b4a9e1bf0b7db3ab71f4f08580da0cb2191d84605dc82a70c324bd122d5cf7R805-R828) fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

### Description of changes

Implemented a [validation function](https://github.com/aws/aws-cdk/pull/32841/files#diff-5d08d37e744e173239879212c59fd45cb9a279349f3dfb1c66923cb015ed3a3a) that collects all validation errors and presents them to the user. Used this function in RDS Database Cluster initialization. I will implement this separately for SQS Queue initialization as a POC for usability.

There are several other places that can make use of this shared code, to show users all validation errors at once. Here's a non-exhaustive list:
- [aws-ec2](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L672-L743)
- [eventbridge-scheduler](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eventbridge-scheduler/create-schedule.ts#L324-L362)
- [aws-fsx](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-fsx/lib/lustre-file-system.ts#L360-L380)

### Describe any new or updated permissions being added

No permissions changes.

### Description of how you validated changes

Added unit tests and modified existing unit tests.

<img width="698" alt="Screenshot 2025-01-16 at 14 51 47" src="https://github.com/user-attachments/assets/a724a16a-7ccc-43b6-8fee-599ec007566d" />

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

(cherry picked from commit 344d916)
moelasmar pushed a commit that referenced this issue Jan 24, 2025
…rops (#32841)

### Issue #32840

Closes #32840

### Reason for this change

When initializing a new RDS DB Cluster, the [current implementation](https://github.com/aws/aws-cdk/pull/32151/files#diff-49b4a9e1bf0b7db3ab71f4f08580da0cb2191d84605dc82a70c324bd122d5cf7R805-R828) fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.

### Description of changes

Implemented a [validation function](https://github.com/aws/aws-cdk/pull/32841/files#diff-5d08d37e744e173239879212c59fd45cb9a279349f3dfb1c66923cb015ed3a3a) that collects all validation errors and presents them to the user. Used this function in RDS Database Cluster initialization. I will implement this separately for SQS Queue initialization as a POC for usability.

There are several other places that can make use of this shared code, to show users all validation errors at once. Here's a non-exhaustive list:
- [aws-ec2](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-ec2/lib/volume.ts#L672-L743)
- [eventbridge-scheduler](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eventbridge-scheduler/create-schedule.ts#L324-L362)
- [aws-fsx](https://github.com/aws/aws-cdk/blob/3e4f3773bfa48b75bf0adc7d53d46bbec7714a9e/packages/aws-cdk-lib/aws-fsx/lib/lustre-file-system.ts#L360-L380)

### Describe any new or updated permissions being added

No permissions changes.

### Description of how you validated changes

Added unit tests and modified existing unit tests.

<img width="698" alt="Screenshot 2025-01-16 at 14 51 47" src="https://github.com/user-attachments/assets/a724a16a-7ccc-43b6-8fee-599ec007566d" />

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

(cherry picked from commit 344d916)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants