From 028495e55fed02f727024a443fc29a17d4629fe3 Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Sat, 3 Oct 2020 02:12:24 +0100 Subject: [PATCH] fix(rds): secret for ServerlessCluster is not accessible programmatically (#10657) In a last-minute change, the secret was changed from public (matching all of the other RDS constructs) to private. This means users who don't specify a secret, and rely on the auto-generated one, have no programmatic means of accessing the secret. Brought up by a user on the CDK.dev Slack channel. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts b/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts index a79b08507f82e..3f2dbfef37c7d 100644 --- a/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts @@ -319,7 +319,8 @@ export class ServerlessCluster extends ServerlessClusterBase { /** * The secret attached to this cluster */ - private readonly secret?: secretsmanager.ISecret; + public readonly secret?: secretsmanager.ISecret; + private readonly subnetGroup: ISubnetGroup; private readonly vpc: ec2.IVpc; private readonly vpcSubnets?: ec2.SubnetSelection; @@ -327,7 +328,7 @@ export class ServerlessCluster extends ServerlessClusterBase { private readonly singleUserRotationApplication: secretsmanager.SecretRotationApplication; private readonly multiUserRotationApplication: secretsmanager.SecretRotationApplication; - constructor(scope:Construct, id: string, props: ServerlessClusterProps) { + constructor(scope: Construct, id: string, props: ServerlessClusterProps) { super(scope, id); this.vpc = props.vpc;