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.
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
});
Cannot read property 'engine' of undefined.
This is :bug: Bug Report
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.
Ideas and suggestions are welcome.
Would it be possible to add the engine property to the IDatabaseCluster?
Any updates on this @civilizeddev ?
Best,
Roland
@I2olanD I'm sorry for late response.
As for this issue, @skinny85 suggested a better solution.
hey @civilizeddev, @skinny85
figured it out :) TY!
Most helpful comment
Sorry, currently not available
DatabaseCluster.fromDatabaseClusterAttributesreturnsIDatabaseCluster, which doesn't haveenginein it.There's no way to read
enginefrom 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.