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

DatabaseCluster: writers and readers not taking publiclyAccessible flag #26077

Closed
mdesousa opened this issue Jun 21, 2023 · 2 comments
Closed
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@mdesousa
Copy link

Describe the bug

We are defining an Aurora Postgres Serverless V2 cluster as follows:

    const cluster = new DatabaseCluster(this, `${id}-serverless-db`, {
      engine: DatabaseClusterEngine.auroraPostgres({
        version: AuroraPostgresEngineVersion.VER_15_2,
      }),
      credentials: Credentials.fromGeneratedSecret("serverless"),
      vpc,
      securityGroups: [dbSecurityGroup],
      vpcSubnets: vpc.selectSubnets({ subnetType: SubnetType.PUBLIC }),
      writer: ClusterInstance.serverlessV2(`${id}-serverless-writer`, {
        publiclyAccessible: true,
      }),
      readers: [
        ClusterInstance.serverlessV2(`${id}-serverless-reader`, {
          publiclyAccessible: true,
          scaleWithWriter: true,
        }),
      ],
    });

however, the new writer and reader instances show in the console with "Publicly Accessible: No", and they are not reachable

Expected Behavior

Configuring publiclyAccessible: true should set the expected accessibility value, and the database should be reachable

Current Behavior

the new writer and reader instances show in the console with "Publicly Accessible: No", and they are not reachable

Reproduction Steps

Use the cdk to deploy as shown in the snippet

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.83.1

Framework Version

No response

Node.js Version

18.15.0

OS

macOS

Language

Typescript

Language Version

TypeScript 5.1.3

Other information

No response

@mdesousa mdesousa added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2023
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Jun 21, 2023
@pahud pahud self-assigned this Jun 22, 2023
@pahud
Copy link
Contributor

pahud commented Jun 22, 2023

According to this logic:

publiclyAccessible = ownedCluster.vpcSubnets && ownedCluster.vpcSubnets.subnetType === ec2.SubnetType.PUBLIC;

I guess you should use subnetSelection for vpcSubnets instead.

vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },

It works for me:

% npx cdk synth | grep PubliclyAccessible
PubliclyAccessible: true
PubliclyAccessible: true

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2023
@pahud pahud removed their assignment Jun 22, 2023
@pahud pahud added p2 effort/medium Medium work item – several days of effort labels Jun 22, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants