File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ export interface PgBouncerProps {
6060 * EC2 instance options
6161 */
6262 instanceProps ?: Partial < ec2 . InstanceProps > ;
63+
64+ /**
65+ * Optional reference to the database bootstrapper CustomResource.
66+ * When provided, the health check will re-trigger if the database setup changes.
67+ */
68+ databaseBootstrapper ?: CustomResource ;
6369}
6470
6571export class PgBouncer extends Construct {
@@ -255,8 +261,10 @@ export class PgBouncer extends Construct {
255261 serviceToken : healthCheckFunction . functionArn ,
256262 properties : {
257263 InstanceId : this . instance . instanceId ,
258- // Add timestamp to force re-execution on stack updates
259- Timestamp : new Date ( ) . toISOString ( ) ,
264+ // Reference the database bootstrapper to re-trigger on database changes
265+ ...( props . databaseBootstrapper && {
266+ DatabaseBootstrapperRef : props . databaseBootstrapper . ref ,
267+ } ) ,
260268 } ,
261269 } ) ;
262270
Original file line number Diff line number Diff line change @@ -276,6 +276,7 @@ export class PgStacDatabase extends Construct {
276276 reservePoolSize : 5 ,
277277 reservePoolTimeout : 5 ,
278278 } ,
279+ databaseBootstrapper : bootstrapper ,
279280 } ) ;
280281
281282 this . _pgBouncerServer . node . addDependency ( bootstrapper ) ;
You can’t perform that action at this time.
0 commit comments