Skip to content

Problem obtaining Connection String property #369

@TadeoCloud

Description

@TadeoCloud

Is there an existing issue for this?

  • I have searched the existing issues

CDK package version

v3.9.0

CFN Resource version

cluster:v2.3.0

CFN Resource Region

eu-west-1

Current Behavior

I unable to obtain the Connection String from the CfnCluster (MongoDB::Atlas::Cluster) L1 property.

I want to get the standard and/o privateLink Connection String from Atlas cluster. In previus version (1.0.2) of this lib I can get at least StandardSrv ConnectionString using L3 construct: this.cluster.atlasBasic.mCluster.connectionStrings.standardSrv

Now using CfnCluster L1 resource in v3.9.0 lib I unable to obtain a Connection String. It doesn't matter if I try to get cluster.props.connectionStrings?.standardSrv, standard, privateSrv, privateEndpointsSrv[0]... All are empty

AWS CDK code to reproduce the issue

import { Construct } from 'constructs';
import { CfnCluster} from 'awscdk-resources-mongodbatlas';

export class MongoCluster extends Construct {
  constructor(scope: Construct, id: string, props: MongoClusterProps) {
    super(scope, id);

    const cluster = new CfnCluster(this, "cluster", {
      projectId: "xxxxxxxxxxx",
      name: "cluster_name",
    });

    new CfnOutput(this, 'standard', {
      value: cluster.props.connectionStrings?.standardSrv ?? 'undefined',
    });

    new CfnOutput(this, 'privateSrv', {
      value: cluster.props.connectionStrings?.privateSrv ?? 'undefined',
      exportName: 'cluster-props-connectionStrings-privateSrv'
    });
  }
}

Steps To Reproduce

  1. Create new CfnCluster
  2. Try to obtain Connection String from CfnCluster props

cdk synth

MongoAtlasMongoprivateF5D73872:
    Value: undefined
  MongoAtlasMongoprivateSrv44B21F6A:
    Value: undefined
  MongoAtlasMongostandardDC6D2AB3:
    Value: undefined
  MongoAtlasMongostandardSrvEFF11DC7:
    Value: undefined

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions