Skip to content

Commit

Permalink
Merge branch 'main' into fix/false-deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Apr 17, 2024
2 parents 545e3d3 + 21804fd commit eecb081
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,8 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase {
constructor(scope: Construct, id: string, props: DatabaseClusterBaseProps) {
super(scope, id);

if ((props.vpc && props.instanceProps?.vpc)) {
if ((props.vpc && props.instanceProps?.vpc) || (!props.vpc && !props.instanceProps?.vpc)) {
throw new Error('Provide either vpc or instanceProps.vpc, but not both');
} else if (!props.vpc && !props.instanceProps?.vpc) {
throw new Error('If instanceProps is not provided then `vpc` must be provided.');
}
if ((props.vpcSubnets && props.instanceProps?.vpcSubnets)) {
throw new Error('Provide either vpcSubnets or instanceProps.vpcSubnets, but not both');
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-rds/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('cluster new api', () => {
iamAuthentication: true,
});
// THEN
}).toThrow(/If instanceProps is not provided then `vpc` must be provided./);
}).toThrow(/Provide either vpc or instanceProps.vpc, but not both/);
});

test('when both vpc and instanceProps.vpc are provided', () => {
Expand Down

0 comments on commit eecb081

Please sign in to comment.