Skip to content

Commit 96bf286

Browse files
lantoliEspenAlbert
andauthored
chore: Rename clusters folder to cluster for L1 cluster resource and syncs with CFN (#277)
Co-authored-by: EspenAlbert <[email protected]>
1 parent ef4c0a5 commit 96bf286

File tree

6 files changed

+27
-56
lines changed

6 files changed

+27
-56
lines changed

API.md

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export {
108108
CfnClusterPropsEncryptionAtRestProvider,
109109
AdvancedRegionConfigProviderName,
110110
Tag,
111-
} from "./l1-resources/clusters";
111+
} from "./l1-resources/cluster";
112112

113113
export {
114114
Action,
File renamed without changes.

src/l1-resources/clusters/index.ts renamed to src/l1-resources/cluster/index.ts

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ export interface CfnClusterProps {
3434
*/
3535
readonly clusterType?: string;
3636

37+
/**
38+
* Set of connection strings that your applications use to connect to this cluster. Use the parameters in this object to connect your applications to this cluster. See the MongoDB [Connection String URI Format](https://docs.mongodb.com/manual/reference/connection-string/) reference for further details.
39+
*
40+
* @schema CfnClusterProps#ConnectionStrings
41+
*/
42+
readonly connectionStrings?: ConnectionStrings;
43+
3744
/**
3845
* Storage capacity that the host's root volume possesses expressed in gigabytes. Increase this number to add capacity. MongoDB Cloud requires this parameter if you set replicationSpecs. If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. Storage charge calculations depend on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier.
3946
*
@@ -148,6 +155,7 @@ export function toJson_CfnClusterProps(
148155
BackupEnabled: obj.backupEnabled,
149156
BiConnector: toJson_CfnClusterPropsBiConnector(obj.biConnector),
150157
ClusterType: obj.clusterType,
158+
ConnectionStrings: toJson_ConnectionStrings(obj.connectionStrings),
151159
DiskSizeGB: obj.diskSizeGb,
152160
EncryptionAtRestProvider: obj.encryptionAtRestProvider,
153161
Profile: obj.profile,
@@ -535,7 +543,7 @@ export function toJson_AdvancedReplicationSpec(
535543
/* eslint-enable max-len, quote-props */
536544

537545
/**
538-
* Advanced configuration details to add for one cluster in the specified project.
546+
* List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster.
539547
*
540548
* @schema tag
541549
*/
@@ -914,11 +922,6 @@ export class CfnCluster extends cdk.CfnResource {
914922
*/
915923
public readonly attrId: string;
916924

917-
/**
918-
* Attribute `MongoDB::Atlas::Cluster.ConnectionStrings`
919-
*/
920-
public readonly connectionStrings: ConnectionStrings;
921-
922925
/**
923926
* Create a new `MongoDB::Atlas::Cluster`.
924927
*
@@ -934,43 +937,9 @@ export class CfnCluster extends cdk.CfnResource {
934937

935938
this.props = props;
936939

937-
const connStringsStandard = cdk.Token.asString(
938-
this.getAtt("ConnectionStrings.Standard")
939-
);
940-
const connStringsStandardSrv = cdk.Token.asString(
941-
this.getAtt("ConnectionStrings.StandardSrv")
942-
);
943-
const connStringsPrivate = cdk.Token.asString(
944-
this.getAtt("ConnectionStrings.Private")
945-
);
946-
const connStringsPrivateSrv = cdk.Token.asString(
947-
this.getAtt("ConnectionStrings.PrivateSrv")
948-
);
949-
950-
const privateEndpoints = cdk.Token.asList(
951-
this.getAtt("ConnectionStrings.PrivateEndpoints")
952-
);
953-
954-
const privateEndpointsSrv = cdk.Token.asList(
955-
this.getAtt("ConnectionStrings.PrivateEndpointsSrv")
956-
);
957-
958-
const srvShardOptimizedConnectionString = cdk.Token.asList(
959-
this.getAtt("ConnectionStrings.SrvShardOptimizedConnectionString")
960-
);
961-
962940
this.attrStateName = cdk.Token.asString(this.getAtt("StateName"));
963941
this.attrMongoDBVersion = cdk.Token.asString(this.getAtt("MongoDBVersion"));
964942
this.attrCreatedDate = cdk.Token.asString(this.getAtt("CreatedDate"));
965943
this.attrId = cdk.Token.asString(this.getAtt("Id"));
966-
this.connectionStrings = {
967-
standard: connStringsStandard,
968-
standardSrv: connStringsStandardSrv,
969-
private: connStringsPrivate,
970-
privateSrv: connStringsPrivateSrv,
971-
privateEndpoints: privateEndpoints,
972-
privateEndpointsSrv: privateEndpointsSrv,
973-
srvShardOptimizedConnectionString: srvShardOptimizedConnectionString,
974-
};
975944
}
976945
}

0 commit comments

Comments
 (0)