Make optimized connection strings available from api
When creating a cluster that has Optimized Connection Strings as documented here: https://www.mongodb.com/docs/atlas/connect-to-database-deployment/#improve-connection-performance-for-sharded-clusters-behind-a-private-endpoint, those connection strings do not appear to be available through the Atlas API, and thus not available through the Terraform provider.
Since legacy connection strings are not the default anymore, it would be important to make those optimized strings available through API and Terraform.
In addition it would be nice to be able to get the legacy connection strings for old drivers even if the cluster qualifies for optimized connection strings. Those legacy connection strings are simply not populated unless the cluster was initially a replicaset or Mongo support intervenes.
this feature has been released as part of v1.10.0. thank you for the feedback.
for more details see: https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/advanced_cluster#connection_strings.private_endpoint.#.srv_shard_optimized_connection_string
-
AdminZuhair (Admin, MongoDB) commented
Hi Benoit, can you try cURL command GET https://cloud.mongodb.com/api/atlas/v1.5/groups/{groupId}/clusters/{clusterName}? Addition details here: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Multi-Cloud-Clusters/operation/getCluster
There are several connection strings details included in response back which may be able to help. In the interim we are working to get this enabled in Terraform as well and should be part of the v1.9.0 release (1-2 months away).