Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rds): incorrect error message for rds proxies #29404

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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