@@ -145,7 +145,7 @@ export class AuroraCluster extends Construct implements IDatabase {
145145 super ( scope , id ) ;
146146
147147 const removalPolicy = props . removalPolicy ?? cdk . RemovalPolicy . RETAIN ;
148- this . instanceParameterGroup = new rds . ParameterGroup ( this , 'ParameterGroup ' , {
148+ this . instanceParameterGroup = new rds . ParameterGroup ( this , 'InstanceParameterGroup ' , {
149149 engine : props . engine ,
150150 description : this . node . path ,
151151 removalPolicy : [ cdk . RemovalPolicy . DESTROY , cdk . RemovalPolicy . RETAIN ] . includes ( removalPolicy )
@@ -158,7 +158,7 @@ export class AuroraCluster extends Construct implements IDatabase {
158158 } ) ;
159159 this . parameterGroup = this . instanceParameterGroup ;
160160
161- this . clusterParameterGroup = new rds . ParameterGroup ( this , 'ClusterParameterGroup ' , {
161+ this . clusterParameterGroup = new rds . ParameterGroup ( this , 'ParameterGroup ' , {
162162 engine : props . engine ,
163163 description : this . node . path ,
164164 removalPolicy : [ cdk . RemovalPolicy . DESTROY , cdk . RemovalPolicy . RETAIN ] . includes ( removalPolicy )
@@ -184,9 +184,9 @@ export class AuroraCluster extends Construct implements IDatabase {
184184
185185 // TODO: Find a better way to pass the parameter group to the writer and readers.
186186 if ( props . writer ) {
187- ( props . writer as any ) . props . parameterGroup = this . parameterGroup ;
187+ ( props . writer as any ) . props . parameterGroup = this . instanceParameterGroup ;
188188 for ( const reader of props . readers ?? [ ] ) {
189- ( reader as any ) . props . parameterGroup = this . parameterGroup ;
189+ ( reader as any ) . props . parameterGroup = this . instanceParameterGroup ;
190190 }
191191 }
192192
@@ -198,7 +198,7 @@ export class AuroraCluster extends Construct implements IDatabase {
198198 props . writer ??
199199 rds . ClusterInstance . provisioned ( 'ClusterInstance' , {
200200 instanceType : AuroraCluster . minimumInstanceType ( props . engine ) ,
201- parameterGroup : this . parameterGroup ,
201+ parameterGroup : this . instanceParameterGroup ,
202202 } ) ,
203203 readers : props . readers ,
204204 vpc : props . networking . vpc ,
@@ -214,7 +214,7 @@ export class AuroraCluster extends Construct implements IDatabase {
214214 } ) ;
215215 // https://github.com/aws/aws-cdk/issues/26072
216216 const cfnCluster = this . resource . node . defaultChild as rds . CfnDBCluster ;
217- cfnCluster . dbInstanceParameterGroupName = this . parameterGroup . bindToInstance ( { } ) . parameterGroupName ;
217+ cfnCluster . dbInstanceParameterGroupName = this . instanceParameterGroup . bindToInstance ( { } ) . parameterGroupName ;
218218 if ( props . networking . bastionHost ) {
219219 this . resource . connections . allowDefaultPortFrom ( props . networking . bastionHost ) ;
220220 }
0 commit comments