Skip to content

Commit

Permalink
chore(aws-rds): add condition to check the instanceCount is a token
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Mar 24, 2021
1 parent 7966f8d commit f9324b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-rds/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ interface InstanceConfig {
*/
function createInstances(cluster: DatabaseClusterNew, props: DatabaseClusterBaseProps, subnetGroup: ISubnetGroup): InstanceConfig {
const instanceCount = props.instances != null ? props.instances : 2;
if (Token.isUnresolved(instanceCount)) {
throw new Error('Instance count is not a token');
}
if (instanceCount < 1) {
throw new Error('At least one instance is required');
}
Expand Down

0 comments on commit f9324b5

Please sign in to comment.