Skip to content

RDS Proxy: adding multiple proxies via addProxy causes a circular dependency in the generated target groups #25633

@benbelow

Description

@benbelow

Describe the bug

adding multiple proxies via addProxy causes a circular dependency in the generated target groups.

Each target group declares an explicit dependency on the other.

Expected Behavior

Two proxies are generated independently

Current Behavior

CDK template cannot be deployed due to circular dependency

Reproduction Steps

const db = new rds.DatabaseCluster(this, 'DatabaseCluster', {
      engine: rds.DatabaseClusterEngine.auroraPostgres({
        version: rds.AuroraPostgresEngineVersion.VER_13_7,
      }),
      instanceProps: {
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
      },
      instances: 1,
      backup: { retention: Duration.days(7) },
      removalPolicy: RemovalPolicy.RETAIN,
      deletionProtection: true,
      credentials: rdsCredentials,
      defaultDatabaseName: this.dbName,
    });

    this.dbProxy = db.addProxy(id + 'proxy', {
      secrets: [rdsSecret],
      vpc: props.vpc,
      debugLogging: false,
      iamAuth: true,
    });

    this.readOnlyDbProxy = db.addProxy(id + 'read-only-proxy', {
      secrets: [rdsReadOnlySecret],
      vpc: props.vpc,
      debugLogging: false,
      iamAuth: true,
    });

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.79.1

Framework Version

No response

Node.js Version

19.7.0

OS

MacOS

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational DatabasebugThis issue is a bug.effort/mediumMedium work item – several days of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions