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.

RDS: add support for creating Proxy endpoints

See original GitHub issue

I have created a rds cluster: image

I am trying to create a rds proxy with both reader and read/write endpoints using AWS CDK

Reproduction Steps

I have created a rds proxy using:

    this.rdsCluster = new DatabaseCluster(this, clusterName, {
      clusterIdentifier: clusterName,
      engine: clusterEngine,
      credentials: {
        username: ResourcePropsConstants.RDS_MASTER_USER,
        excludeCharacters: ';',
      },
      instanceProps: {
        instanceType: new InstanceType(RdsUtils.determineInstanceSize(envName)),
        vpc: this.iVpc,
        vpcSubnets: {
          subnetType: SubnetType.PRIVATE,
        },
        securityGroups: [this.iRdsSG],
      },
      storageEncrypted: true,
      backup: {
        retention: Duration.days(RdsUtils.determineRetentionPeriod(envName)),
      },
      parameterGroup: this.parameterGroup,
      deletionProtection: isHigherEnv,
    });
    
    this.rdsProxy = this.rdsCluster.addProxy(dbProxyName, {
      dbProxyName,
      borrowTimeout: Duration.minutes(3),
      maxConnectionsPercent: 85,
      maxIdleConnectionsPercent: 10,
      idleClientTimeout: Duration.minutes(15),
      requireTLS: true,
      secrets: [this.rdsSecret],
      securityGroups: [this.iRdsProxySG],
      vpcSubnets: {
        subnetType: SubnetType.PRIVATE,
      },
      vpc: this.iVpc,
    });

What did you expect to happen?

I am expecting two endpoints to be created in the proxy - one with Read/Write and the other with Read target role. When I manually create a proxy using AWS Console a proxy is created with two endpoints

What actually happened?

Only one endpoint was created with Read/Write target role

Environment

  • **CDK CLI Version :1.66
  • Framework Version:
  • Node.js Version:
  • OS :
  • Language (Version): – Typescript

Other


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
skinny85commented, Apr 20, 2021

Ok. Looks like there’s a resource called AWS::RDS::DBProxyEndpoint. This is probably what’s missing from the DatabaseProxy class today.

You can create them today by using the CfnDBProxyEndpoint from the CDK. I’ll keep this issue open as a feature request to add support for Proxy endpoints to our DatabaseProxy class.

1reaction
Jaccocommented, May 23, 2022

I am going for the following approach:

On DatabaseProxy:

  public addEndpoint(options: DatabaseProxyEndpointOptions): IDatabaseProxyEndpoint {
    const endpoint = new DatabaseProxyEndpoint(this, 'EndPoint', {
      ...options,
      dbProxy: this,
    });
    this.endpoints.push(endpoint.endpoint);
    return endpoint;
  }

Note to self: I need to add an index to the id to make it unique in the scope

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Amazon RDS Proxy endpoints - Amazon Aurora
You can create and connect to read-only endpoints called reader endpoints when you use RDS Proxy with Aurora clusters. These reader endpoints help...
Read more >
RDS Proxy concepts and terminology
RDS Proxy supports TLS protocol version 1.0, 1.1, and 1.2. You can connect to the proxy using a higher version of TLS than...
Read more >
8.4: Use RDS Proxy to minimize failover disruptions
Open the Amazon RDS service console . Click on the Proxies Link on the Navigation Bar on the left. Click on Create proxy....
Read more >
AWS Supports You | Diving Deep into Amazon RDS Proxy for ...
We would love to hear your feedback about our show! Please take our survey here: ...
Read more >
Use Amazon RDS Proxy with read-only endpoints
RDS Proxy lets you create additional endpoints with either a read-only or read/write role. An endpoint with a read-only role routes your queries ......
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