question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-cdk] rds module not able to add proxy

See original GitHub issue

Hey, i’m currently trying to add a RDS proxy to my db cluster. Apparently, i get following error: Cannot read property ‘engine’ of undefined.

Reproduction Steps

		const vpc = ec2.Vpc.fromLookup(myScope, 'someId', { 
			vpcId: 'vpc-id'
		});

		const securityGroup = ec2.SecurityGroup.fromSecurityGroupId(myScope, 
			'someId', 
			'securit-group-id'
		);

		const cluster = DatabaseCluster.fromDatabaseClusterAttributes(myScope, 'someId', {
			port,
			securityGroups: [securityGroup],
			clusterIdentifier: 'cluster-identifier',
			instanceIdentifiers: ['instance-identifier'],
			clusterEndpointAddress: ''writer-endpoint,
			readerEndpointAddress: 'reader-endpoint',
			instanceEndpointAddresses: ['instance endpoint']
		});

		const secret = new Secret(myScope, 'Secret');

		cluster.addProxy('testProxy', {
			borrowTimeout: cdk.Duration.seconds(30),
			maxConnectionsPercent: 50,
			secrets: [secret],
			vpc
		});

Error Log

Cannot read property ‘engine’ of undefined.

Environment

  • **CLI Version :1.53.0
  • **Framework Version: 1.53.0
  • **Node.js Version: 10.19.0
  • OS :
  • **Language (Version): all

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
civilizeddevcommented, Jul 22, 2020

Sorry, currently not available

DatabaseCluster.fromDatabaseClusterAttributes returns IDatabaseCluster, which doesn’t have engine in it.

There’s no way to read engine from imported RDS instance/cluster resource at the moment.

Its’ unstable that it currently rely on (this.dbCluster.node.defaultChild as CfnDBCluster).engine.

https://github.com/aws/aws-cdk/blob/489eae64f6613cac85da2a70b33435052901255b/packages/%40aws-cdk/aws-rds/lib/proxy.ts#L69-L75

Ideas and suggestions are welcome.

2reactions
I2olanDcommented, Sep 16, 2020

Any updates on this @civilizeddev ?

Best,

Roland

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting for RDS Proxy - Amazon Aurora
Some possible reasons include the following: The proxy can't establish a database connection because the maximum connections have been reached. The proxy can't ......
Read more >
@aws-cdk/aws-rds - npm
The following example shows granting connection access for RDS Proxy to an IAM role. declare const vpc: ec2. Vpc; const cluster = new...
Read more >
How to Connect to AWS RDS from AWS Lambda
In this article, we're going to learn about how to communicate with AWS RDS from AWS Lambda. In this tutorial, we'll be using...
Read more >
How to add a security group to an existing RDS with CDK ...
Also maybe the other way round the RDS security group might be better described by aws_rds module rather than aws_ec2 module ...
Read more >
Create a Rest API with AWS API Gateway, a Lambda function ...
Since we believe that AWS CDK is one of the most advanced tools ... the AWS resources needed for a Rest API that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found