Skip to content

Commit ce29095

Browse files
committed
chore: set parametergroup in writer and reader
1 parent 883dee4 commit ce29095

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

API.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constructs/aurora-cluster.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ export class AuroraCluster extends Construct implements IDatabase {
149149
securityGroupName: props.securityGroupName ?? `${this.node.path.replace(/\//g, '-')}-sg`,
150150
});
151151

152+
// TODO: Find a better way to pass the parameter group to the writer and readers.
153+
if (props.writer) {
154+
(props.writer as any).props.parameterGroup = this.parameterGroup;
155+
for (const reader of props.readers ?? []) {
156+
(reader as any).props.parameterGroup = this.parameterGroup;
157+
}
158+
}
159+
152160
this.resource = new rds.DatabaseCluster(this, 'DB', {
153161
clusterIdentifier: props.clusterIdentifier,
154162
engine: props.engine,
@@ -157,6 +165,7 @@ export class AuroraCluster extends Construct implements IDatabase {
157165
props.writer ??
158166
rds.ClusterInstance.provisioned('ClusterInstance', {
159167
instanceType: AuroraCluster.minimumInstanceType(props.engine),
168+
parameterGroup: this.parameterGroup,
160169
}),
161170
readers: props.readers,
162171
vpc: props.networking.vpc,

0 commit comments

Comments
 (0)