AWS documentdb documentation change
Summary
Updated code examples to use unquoted placeholders, added user input replacement instructions, and standardized placeholder formatting across multiple language examples
Security assessment
Changes primarily focus on improving documentation clarity and consistency by removing angle brackets from placeholders and adding reminders to replace sample credentials. While these changes promote security best practices (like not using sample credentials), there's no evidence they address a specific security vulnerability or introduce new security features.
Diff
diff --git a/documentdb/latest/developerguide/connect_programmatically.md b/documentdb/latest/developerguide/connect_programmatically.md index 1aa7d68cb..8abbbb6f6 100644 --- a//documentdb/latest/developerguide/connect_programmatically.md +++ b//documentdb/latest/developerguide/connect_programmatically.md @@ -46 +46 @@ Using the AWS CLI -The following AWS CLI code determines which parameter is governing your cluster. Make sure you replace `sample-cluster` with the name of your cluster. +The following AWS CLI code determines which parameter is governing your cluster. Make sure you replace ``sample-cluster`` with the name of your cluster. @@ -80,0 +81,2 @@ You can use the `describe-db-cluster-parameters` AWS CLI command to view the det +In the following examples, replace each `user input placeholder` with your cluster's information. + @@ -144,0 +147,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Python +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -150 +154 @@ The following code demonstrates how to connect to Amazon DocumentDB using Python - client = pymongo.MongoClient('mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') + client = pymongo.MongoClient('mongodb://sample-user:[email protected]:27017/?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') @@ -178,0 +183,2 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -186 +192 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic - 'mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/sample-database?tls=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false', + 'mongodb://sample-user:[email protected]:27017/sample-database?tls=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false', @@ -218,0 +225,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using PHP wh +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -227 +235 @@ The following code demonstrates how to connect to Amazon DocumentDB using PHP wh - $client = new MongoDB\Client("mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/?retryWrites=false", ["tls" => "true", "tlsCAFile" => $TLS_DIR ]); + $client = new MongoDB\Client("mongodb://sample-user:[email protected]:27017/?retryWrites=false", ["tls" => "true", "tlsCAFile" => $TLS_DIR ]); @@ -250,0 +259,2 @@ As of version 1.2.1, the MongoDB Go Driver will only use the first CA server cer +In the following examples, replace each `user input placeholder` with your cluster's information. + @@ -277,2 +287,2 @@ As of version 1.2.1, the MongoDB Go Driver will only use the first CA server cer - username = "<sample-user>" - password = "<password>" + username = "sample-user" + password = "password" @@ -381 +391 @@ When connecting to a TLS-enabled Amazon DocumentDB cluster from a Java applicati - 2. Create a trust store with the CA certificate contained in the file by performing the following commands. Be sure to change the `<truststorePassword>` to something else. If you are accessing a trust store that contains both the old CA certificate (`rds-ca-2015-root.pem`) and the new CA certificate (`rds-ca-2019-root.pem`), you can import the certificate bundle into the trust store. + 2. Create a trust store with the CA certificate contained in the file by performing the following commands. Be sure to change the `truststore-password` to something else. If you are accessing a trust store that contains both the old CA certificate (`rds-ca-2015-root.pem`) and the new CA certificate (`rds-ca-2019-root.pem`), you can import the certificate bundle into the trust store. @@ -383 +393 @@ When connecting to a TLS-enabled Amazon DocumentDB cluster from a Java applicati -The following is a sample shell script that imports the certificate bundle into a trust store on a Linux operating system. In the following example, replace each `user input placeholder `with your own information. Most notably, wherever the example directory "`mydir`" is located in the script, replace it with a directory you created for this task. +The following is a sample shell script that imports the certificate bundle into a trust store on a Linux operating system. In the following examples, replace each `user input placeholder `with your own information. Most notably, wherever the example directory "`mydir`" is located in the script, replace it with a directory you created for this task. @@ -387 +397 @@ The following is a sample shell script that imports the certificate bundle into - storepassword=<truststorePassword> + storepassword=truststore-password @@ -414 +424 @@ The following is a sample shell script that imports the certificate bundle into - storepassword=<truststorePassword> + storepassword=truststore-password @@ -438,2 +448,2 @@ The following is a sample shell script that imports the certificate bundle into - javax.net.ssl.trustStore: <truststore> - javax.net.ssl.trustStorePassword: <truststorePassword> + javax.net.ssl.trustStore: truststore + javax.net.ssl.trustStorePassword: truststore-password; @@ -442,0 +453,2 @@ The following is a sample shell script that imports the certificate bundle into +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -454,2 +466,2 @@ The following is a sample shell script that imports the certificate bundle into - String username = "<sample-user>"; - String password = "<password>"; + String username = "sample-user"; + String password = "password"; @@ -460,2 +472,2 @@ The following is a sample shell script that imports the certificate bundle into - String truststore = "<truststore>"; - String truststorePassword = "<truststorePassword>"; + String truststore = "truststore"; + String truststorePassword = "truststore-password"; @@ -493,0 +506,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using C# / . +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -512,2 +526,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using C# / . - string username = "<sample-user>"; - string password = "<password>"; + string username = "sample-user"; + string password = "password"; @@ -561,0 +576,2 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic +In the following examples, replace each `user input placeholder` with your cluster's information. + @@ -563 +579 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic - mongosh --tls --host <cluster-end-point>:27017 --tlsCAFile global-bundle.pem --username <sample-user> --password <password> --retryWrites false + mongosh --tls --host cluster-end-point:27017 --tlsCAFile global-bundle.pem --username sample-user --password password --retryWrites false @@ -570 +586 @@ If you use IAM, you must use a previous version of mongo shell. Enter one of the - mongo --ssl --host <cluster-end-point>:27017 --sslCAFile global-bundle.pem --username <sample-user> --password <password> + mongo --ssl --host cluster-end-point:27017 --sslCAFile global-bundle.pem --username sample-user --password password @@ -575 +591 @@ If you are using a version equal to or greater than 4.2, use the following code - mongo --tls --host <cluster-end-point>:27017 --tlsCAFile global-bundle.pem --username <sample-user> --password <password> + mongo --tls --host cluster-end-point:27017 --tlsCAFile global-bundle.pem --username sample-user --password password @@ -594,0 +611,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with R using +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -599 +617 @@ The following code demonstrates how to connect to Amazon DocumentDB with R using - mongourl <- paste("mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/test2?ssl=true&", + mongourl <- paste("mongodb://sample-user:[email protected]:27017/test2?ssl=true&", @@ -617,0 +636,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with Ruby wh +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -627,2 +647,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with Ruby wh - user: '<sample-user>', - password: '<password>', + user: 'sample-user', + password: 'password', @@ -631 +651 @@ The following code demonstrates how to connect to Amazon DocumentDB with Ruby wh - ssl_ca_cert: <'PATH/global-bundle.pem'>, + ssl_ca_cert: 'PATH/global-bundle.pem', @@ -664,0 +685,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Python +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -671 +693 @@ The following code demonstrates how to connect to Amazon DocumentDB using Python - client = pymongo.MongoClient('mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') + client = pymongo.MongoClient('mongodb://sample-user:[email protected]:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false') @@ -699,0 +722,2 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -706 +730 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic - 'mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/sample-database?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false', + 'mongodb://sample-user:[email protected]:27017/sample-database?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false', @@ -737,0 +762,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using PHP wh +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -744 +770 @@ The following code demonstrates how to connect to Amazon DocumentDB using PHP wh - $client = new MongoDB\Client("mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/?retryWrites=false"); + $client = new MongoDB\Client("mongodb://sample-user:[email protected]:27017/?retryWrites=false"); @@ -763,0 +790,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Go whe +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -782,2 +810,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Go whe - username = "<sample-user>" - password = "<password>" + username = "sample-user" + password = "password" @@ -859,0 +888,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Java w +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -879,2 +909,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using Java w - String username = "<sample-user>"; - String password = "<password>"; + String username = "sample-user"; + String password = "password"; @@ -910,0 +941,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using C# / . +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -929,2 +961,2 @@ The following code demonstrates how to connect to Amazon DocumentDB using C# / . - string username = "<sample-user>"; - string password = "<password>"; + string username = "sample-user"; + string password = "password"; @@ -956,0 +989,2 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic +In the following examples, replace each `user input placeholder` with your cluster's information. + @@ -958 +992 @@ There is a known limitation with Node.js drivers older than version 6.13.1, whic - mongosh --host <cluster-end-point>:27017 --username <sample-user> --password <password> --retryWrites false + mongosh --host cluster-end-point:27017 --username sample-user --password password --retryWrites false @@ -965 +999 @@ If you use IAM, you must use a previous version of mongo shell. Enter one of the - mongo --host <cluster-end-point>:27017 --username <sample-user> --password <password> + mongo --host cluster-end-point:27017 --username sample-user --password password @@ -970 +1004 @@ If you are using a version equal to or greater than 4.2, use the following code - mongo --host <cluster-end-point>:27017 --username <sample-user> --password <password> + mongo --host cluster-end-point:27017 --username sample-user --password password @@ -989,0 +1024,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with R using +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -996 +1032 @@ The following code demonstrates how to connect to Amazon DocumentDB with R using - client <- mongo(url = "mongodb://<sample-user>:<password>@sample-cluster.node.us-east-1.docdb.amazonaws.com:27017/sample-database?readPreference=secondaryPreferred&replicaSet=rs0") + client <- mongo(url = "mongodb://sample-user:[email protected]:27017/sample-database?readPreference=secondaryPreferred&replicaSet=rs0") @@ -1009,0 +1046,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with Ruby wh +In the following example, replace each `user input placeholder` with your cluster's information. + @@ -1019,2 +1057,2 @@ The following code demonstrates how to connect to Amazon DocumentDB with Ruby wh - user: '<sample-user>', - password: '<password>', + user: 'sample-user', + password: 'password',