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

RDS: support passing PreferredMaintenanceWindow to Cluster's writer and reader instances #29687

Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@Konosh93
Copy link
Contributor

Konosh93 commented Apr 2, 2024

Describe the bug

Related:

When creating a DatabaseCluster it should be possible to specify PreferredMaintenanceWindow property for the database instances as per https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html#cfn-rds-dbinstance-preferredmaintenancewindow

Expected Behavior

Should be able specify the writer and readers PreferredMaintenanceWindow prop without using the deprecated instanceProps property.

Expected style:

new DatabaseCluster(stack, 'DatabaseCluster', {
  engine: DatabaseClusterEngine.AURORA,
  vpc: vpc,
  writer: ClusterInstance.provisioned('Instance1', {
    preferredMaintenanceWindow: 'Sat:22:15-Sat:22:45',
  }),
  preferredMaintenanceWindow: 'Sat:22:15-Sat:22:45',
});

Current Behavior

Can specify the PreferredMaintenanceWindow prop only through instanceProps:

declare const vpc: ec2.Vpc;
new rds.DatabaseCluster(this, 'DatabaseCluster', {
  engine: rds.DatabaseClusterEngine.AURORA,
  instanceProps: {
    vpc: vpc,
    preferredMaintenanceWindow: 'Sun:23:15-Sun:23:45',
  },
  preferredMaintenanceWindow: 'Sat:22:15-Sat:22:45',
});

Reproduction Steps

Trying adding preferredMaintenanceWindow to writer or readers props:

new DatabaseCluster(stack, 'DatabaseCluster', {
  engine: DatabaseClusterEngine.AURORA,
  vpc: vpc,
  writer: ClusterInstance.provisioned('Instance1', {
    preferredMaintenanceWindow: 'Sat:22:15-Sat:22:45', // Typescript error and wont be reflected in the synthesized templates
  }),
  preferredMaintenanceWindow: 'Sat:22:15-Sat:22:45',
});

Possible Solution

feat(rds): allow specifying PreferredMaintenanceWindow in RDS cluster instances using the new api

Additional Information/Context

No response

CDK CLI Version

1.158.0

Framework Version

No response

Node.js Version

v18.17.1

OS

Linux

Language

TypeScript

Language Version

5.1.6

Other information

No response

@Konosh93 Konosh93 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 2, 2024
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Apr 2, 2024
@khushail
Copy link
Contributor

khushail commented Apr 2, 2024

Thanks @Konosh93 for reporting this and submitting a PR !

@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Apr 2, 2024
mergify bot pushed a commit that referenced this issue Apr 5, 2024
…ps (#29686)

### Issue #29687 

Closes ##29687 

### Reason for this change

Since `instanceProps` is deprecated it is better to allow setting `PreferredMaintenanceWindow` using writer and readers props.

### Description of changes

Added optional preferredMaintenanceWindow field to ClusterInstanceOptions and added a unit test.

### Description of how you validated changes

- Add a single unit test

### 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*
@Konosh93
Copy link
Contributor Author

Konosh93 commented Apr 7, 2024

@Konosh93 Konosh93 closed this as completed Apr 7, 2024
Copy link

github-actions bot commented Apr 7, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
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 bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
3 participants