Skip to content

Commit d5af459

Browse files
committed
DOCSP-26403: changes to aws credential retrieval (#691)
* DOCSP-26403: changes to aws credential retrieval * formatting fixes * capitalization * DB PR fixes 1 (cherry picked from commit 5bcdb61)
1 parent 2704677 commit d5af459

File tree

2 files changed

+56
-22
lines changed

2 files changed

+56
-22
lines changed

source/fundamentals/authentication/mechanisms.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@ The driver checks for your credentials in the following sources in order:
235235
.. literalinclude:: /code-snippets/authentication/aws-env-variable.js
236236
:language: javascript
237237

238+
.. important:: Retrieval of AWS Credentials
239+
240+
Starting in version 4.11, when you install the optional
241+
``aws-sdk/credential-providers`` dependency, the driver uses the AWS SDK
242+
to retrieve credentials from the environment. As a result, if you
243+
have a shared AWS credentials file or config file, the driver will
244+
use those credentials by default.
245+
246+
You can override this behavior by performing one of the following
247+
actions:
248+
249+
- Set ``AWS_SHARED_CREDENTIALS_FILE`` variable in your shell to point
250+
to your credentials file.
251+
- Set the equivalent environment variable in your application to point
252+
to your credentials file.
253+
- Create an AWS profile for your MongoDB credentials and set the
254+
``AWS_PROFILE`` environment variable to that profile name.
255+
238256
``X.509``
239257
---------
240258

source/whats-new.txt

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ New features of the 5.0 {+driver-short+} release include:
106106
This change is for Typescript only, and does not affect queries or operations
107107
at runtime.
108108

109-
- Optional installation of ``@aws-sdk/credential-providers`` as a dependency.
109+
- Optional installation of ``@aws-sdk/credential-providers`` as a peer dependency.
110110

111111
- The driver no longer includes AWS SDK modules by default. Use the
112112
following ``npm`` command to install the SDK:
@@ -202,19 +202,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
202202
What's New in 4.11
203203
------------------
204204

205+
Prioritization Order in Monitoring
206+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207+
205208
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
206209
``electionId`` settings before ``setVersion`` settings during Server Discovery and
207210
Monitoring events. In previous versions, the prioritization order was reversed.
208211

209-
This release also includes added support for **mutually
212+
Changes to AWS Authentication
213+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214+
215+
When you install the optional ``aws-sdk/credential-providers``
216+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
217+
environment.
218+
219+
To learn more about this behavior, see the :ref:`MONGODB-AWS
220+
<mongodb-aws>` section of the Authentication Mechanisms guide.
221+
222+
Mutually Recursive Schema Type Checking
223+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224+
225+
This release includes added support for **mutually
210226
recursive** collection schema types. The driver also provides type safety for
211227
dot-notation queries up to a depth of eight in this release. At a depth greater
212228
than or equal to eight, Typescript successfully compiles your code but does not
213229
provide type safety. This depth limit on recursive types is a current limitation
214230
of TypeScript.
215231

216-
Mutually Recursive Schema Type Checking Example
217-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
232+
Example
233+
```````
218234

219235
Suppose we have a collection of type ``Collection<Author>`` that contains the
220236
following mutually recursive types:
@@ -452,7 +468,7 @@ Key Changes
452468
~~~~~~~~~~~
453469

454470
Node.js Version
455-
+++++++++++++++
471+
```````````````
456472

457473
The minimum supported version of Node.js is now v12.9 or greater for
458474
version 4 of the driver. Support for our 3.x branches will continue
@@ -464,7 +480,7 @@ until summer 2022 to allow time to upgrade.
464480

465481

466482
Cursor Improvements
467-
+++++++++++++++++++
483+
```````````````````
468484

469485
Our Cursor implementation is now updated to make it clear what is possible
470486
before and after execution of an operation.
@@ -496,7 +512,7 @@ similar to the following:
496512
- ``ListCollectionsCursor``
497513

498514
Cursor Stream API
499-
^^^^^^^^^^^^^^^^^
515+
+++++++++++++++++
500516

501517
Our Cursor types no longer extend ``Readable`` directly. They must be
502518
transformed into a stream by calling ``cursor.stream()``.
@@ -516,7 +532,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
516532
asynchronous iteration.
517533

518534
``MongoClientOptions`` Interface
519-
+++++++++++++++++++++++++++++++++
535+
````````````````````````````````
520536

521537
With type hinting, you should find that options passed to a ``MongoClient``
522538
are enumerated and discoverable. We've made a large effort to process
@@ -531,7 +547,7 @@ to get your app up and running in a correct state quickly.
531547
- It is no longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
532548

533549
``createCollection()``
534-
++++++++++++++++++++++
550+
``````````````````````
535551

536552
This method no longer supports a ``strict`` option, which returned
537553
an error if the collection did not exist. To assert the existence of
@@ -550,7 +566,7 @@ a collection, use the ``listCollections()`` method instead.
550566
}
551567

552568
``BulkWriteError`` → ``MongoBulkWriteError``
553-
++++++++++++++++++++++++++++++++++++++++++++
569+
````````````````````````````````````````````
554570

555571
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
556572

@@ -559,20 +575,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
559575
when testing for errors in bulk operations.
560576

561577
``DB``
562-
++++++
578+
``````
563579

564580
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
565581
``MongoClient`` instance.
566582

567583
``Collection.group()``
568-
++++++++++++++++++++++
584+
``````````````````````
569585

570586
The ``Collection.group()`` helper, deprecated since MongoDB 3.4,
571587
is now removed. Use the aggregation pipeline :manual:`$group </reference/operator/aggregation/group/#pipe._S_group>`
572588
operator instead.
573589

574590
Authentication
575-
++++++++++++++
591+
``````````````
576592

577593
- ``gssapiServiceName`` is now removed. Use `authMechanismProperties.SERVICE_NAME <{+api+}/interfaces/MongoClientOptions.html#authMechanismProperties>`__ in the URI or as an option on ``MongoClientOptions``.
578594

@@ -596,15 +612,15 @@ Authentication
596612
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
597613

598614
``GridStore`` Removal
599-
+++++++++++++++++++++
615+
`````````````````````
600616

601617
The GridStore API (already deprecated in 3.x) is now replaced with ``GridFSBucket``.
602618
For more information on ``GridFS``, see the :manual:`mongodb manual </core/gridfs>`.
603619

604620
Below are some snippets that represent equivalent operations.
605621

606622
Construction
607-
^^^^^^^^^^^^
623+
++++++++++++
608624

609625
.. example::
610626

@@ -616,7 +632,7 @@ Construction
616632
const bucket = new GridFSBucket(client.db('test')[,options])
617633

618634
File Seeking
619-
^^^^^^^^^^^^
635+
++++++++++++
620636

621637
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
622638
by using the ``start`` and ``end`` options, creating a download stream
@@ -629,7 +645,7 @@ from your ``GridFSBucket``.
629645
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
630646

631647
File Upload & Download
632-
^^^^^^^^^^^^^^^^^^^^^^
648+
++++++++++++++++++++++
633649

634650
.. example::
635651

@@ -668,7 +684,7 @@ File Upload & Download
668684
``GridFSBucket`` does not need to be closed like ``GridStore``.
669685

670686
File Deletion
671-
^^^^^^^^^^^^^
687+
+++++++++++++
672688

673689
.. example::
674690

@@ -680,7 +696,7 @@ File Deletion
680696
bucket.delete(file_id);
681697

682698
Finding File Metadata
683-
^^^^^^^^^^^^^^^^^^^^^
699+
+++++++++++++++++++++
684700

685701
File metadata that used to be accessible on the ``GridStore`` instance can be
686702
found by querying the bucket.
@@ -692,7 +708,7 @@ found by querying the bucket.
692708
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
693709

694710
Unified Topology
695-
++++++++++++++++
711+
````````````````
696712

697713
- We internally now only manage a ``unifiedTopology`` when you connect
698714
to a ``mongod``. The differences between this and previous versions
@@ -704,13 +720,13 @@ Unified Topology
704720
to connect to uninitialized replica set members.
705721

706722
Explain
707-
+++++++
723+
```````
708724

709725
Support is now added for fine-grained verbosity modes. You can learn more
710726
about each mode :manual:`here </reference/method/cursor.explain/#behavior/>`.
711727

712728
Command Monitoring
713-
++++++++++++++++++
729+
``````````````````
714730

715731
The ``instrument()`` method is now removed. Use command monitoring instead.
716732
See our guide on :doc:`command monitoring </fundamentals/monitoring/command-monitoring>`

0 commit comments

Comments
 (0)