Skip to content

Commit

Permalink
Move autoscaling to cluster construct
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Jul 5, 2023
1 parent 4ca8f4d commit 29440c7
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions infrastructure/cdk/src/providers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,9 @@ export class UsersStack extends cdk.Stack {
subnetType: ec2.SubnetType.PUBLIC
}
},
port: 5432
})

/** Add DB cluster autoscaling */
cdk.Aspects.of(dbCluster).add({
visit(node) {
if (node instanceof rds.CfnDBCluster) {
node.serverlessV2ScalingConfiguration = {
minCapacity: 0.5,
maxCapacity: 1
}
}
}
port: 5432,
serverlessV2MinCapacity: 0.5,
serverlessV2MaxCapacity: 1
})
}
}

0 comments on commit 29440c7

Please sign in to comment.