Skip to content

Commit

Permalink
fix(rds): incorrect error message for rds proxies (#29404)
Browse files Browse the repository at this point in the history
Closes #29402.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
msambol authored Mar 8, 2024
1 parent 110c79f commit 2dbb381
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/aws-cdk-lib/aws-rds/lib/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export class ProxyTarget {

const engineFamily = engine.engineFamily;
if (!engineFamily) {
throw new Error(`Engine '${engineDescription(engine)}' does not support proxies`);
throw new Error('RDS proxies require an engine family to be specified on the database cluster or instance. ' +
`No family specified for engine '${engineDescription(engine)}'`);
}

// allow connecting to the Cluster/Instance from the Proxy
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-rds/test/proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('proxy', () => {
vpc,
secrets: [new secretsmanager.Secret(stack, 'Secret')],
});
}).toThrow(/Engine 'mariadb-10\.0\.24' does not support proxies/);
}).toThrow(/RDS proxies require an engine family to be specified on the database cluster or instance. No family specified for engine 'mariadb-10\.0\.24'/);
});

test('correctly creates a proxy for an imported Cluster if its engine is known', () => {
Expand Down

0 comments on commit 2dbb381

Please sign in to comment.