Skip to content

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

@Konosh93

Description

@Konosh93

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational DatabasebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions