Skip to content

Commit 1e8b3ba

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 81ee205 commit 1e8b3ba

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
@@ -138,7 +138,7 @@ New features of the 5.0 {+driver-short+} release include:
138138
This change is for Typescript only, and does not affect queries or operations
139139
at runtime.
140140

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

143143
- The driver no longer includes AWS SDK modules by default. Use the
144144
following ``npm`` command to install the SDK:
@@ -234,19 +234,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
234234
What's New in 4.11
235235
------------------
236236

237+
Prioritization Order in Monitoring
238+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
239+
237240
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
238241
``electionId`` settings before ``setVersion`` settings during Server Discovery and
239242
Monitoring events. In previous versions, the prioritization order was reversed.
240243

241-
This release also includes added support for **mutually
244+
Changes to AWS Authentication
245+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246+
247+
When you install the optional ``aws-sdk/credential-providers``
248+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
249+
environment.
250+
251+
To learn more about this behavior, see the :ref:`MONGODB-AWS
252+
<mongodb-aws>` section of the Authentication Mechanisms guide.
253+
254+
Mutually Recursive Schema Type Checking
255+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256+
257+
This release includes added support for **mutually
242258
recursive** collection schema types. The driver also provides type safety for
243259
dot-notation queries up to a depth of eight in this release. At a depth greater
244260
than or equal to eight, Typescript successfully compiles your code but does not
245261
provide type safety. This depth limit on recursive types is a current limitation
246262
of TypeScript.
247263

248-
Mutually Recursive Schema Type Checking Example
249-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264+
Example
265+
```````
250266

251267
Suppose we have a collection of type ``Collection<Author>`` that contains the
252268
following mutually recursive types:
@@ -484,7 +500,7 @@ Key Changes
484500
~~~~~~~~~~~
485501

486502
Node.js Version
487-
+++++++++++++++
503+
```````````````
488504

489505
The minimum supported version of Node.js is now v12.9 or greater for
490506
version 4 of the driver. Support for our 3.x branches will continue
@@ -496,7 +512,7 @@ until summer 2022 to allow time to upgrade.
496512

497513

498514
Cursor Improvements
499-
+++++++++++++++++++
515+
```````````````````
500516

501517
Our Cursor implementation is now updated to make it clear what is possible
502518
before and after execution of an operation.
@@ -528,7 +544,7 @@ similar to the following:
528544
- ``ListCollectionsCursor``
529545

530546
Cursor Stream API
531-
^^^^^^^^^^^^^^^^^
547+
+++++++++++++++++
532548

533549
Our Cursor types no longer extend ``Readable`` directly. They must be
534550
transformed into a stream by calling ``cursor.stream()``.
@@ -548,7 +564,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
548564
asynchronous iteration.
549565

550566
``MongoClientOptions`` Interface
551-
+++++++++++++++++++++++++++++++++
567+
````````````````````````````````
552568

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

565581
``createCollection()``
566-
++++++++++++++++++++++
582+
``````````````````````
567583

568584
This method no longer supports a ``strict`` option, which returned
569585
an error if the collection did not exist. To assert the existence of
@@ -582,7 +598,7 @@ a collection, use the ``listCollections()`` method instead.
582598
}
583599

584600
``BulkWriteError`` → ``MongoBulkWriteError``
585-
++++++++++++++++++++++++++++++++++++++++++++
601+
````````````````````````````````````````````
586602

587603
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
588604

@@ -591,20 +607,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
591607
when testing for errors in bulk operations.
592608

593609
``DB``
594-
++++++
610+
``````
595611

596612
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
597613
``MongoClient`` instance.
598614

599615
``Collection.group()``
600-
++++++++++++++++++++++
616+
``````````````````````
601617

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

606622
Authentication
607-
++++++++++++++
623+
``````````````
608624

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

@@ -628,15 +644,15 @@ Authentication
628644
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
629645

630646
``GridStore`` Removal
631-
+++++++++++++++++++++
647+
`````````````````````
632648

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

636652
Below are some snippets that represent equivalent operations.
637653

638654
Construction
639-
^^^^^^^^^^^^
655+
++++++++++++
640656

641657
.. example::
642658

@@ -648,7 +664,7 @@ Construction
648664
const bucket = new GridFSBucket(client.db('test')[,options])
649665

650666
File Seeking
651-
^^^^^^^^^^^^
667+
++++++++++++
652668

653669
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
654670
by using the ``start`` and ``end`` options, creating a download stream
@@ -661,7 +677,7 @@ from your ``GridFSBucket``.
661677
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
662678

663679
File Upload & Download
664-
^^^^^^^^^^^^^^^^^^^^^^
680+
++++++++++++++++++++++
665681

666682
.. example::
667683

@@ -700,7 +716,7 @@ File Upload & Download
700716
``GridFSBucket`` does not need to be closed like ``GridStore``.
701717

702718
File Deletion
703-
^^^^^^^^^^^^^
719+
+++++++++++++
704720

705721
.. example::
706722

@@ -712,7 +728,7 @@ File Deletion
712728
bucket.delete(file_id);
713729

714730
Finding File Metadata
715-
^^^^^^^^^^^^^^^^^^^^^
731+
+++++++++++++++++++++
716732

717733
File metadata that used to be accessible on the ``GridStore`` instance can be
718734
found by querying the bucket.
@@ -724,7 +740,7 @@ found by querying the bucket.
724740
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
725741

726742
Unified Topology
727-
++++++++++++++++
743+
````````````````
728744

729745
- We internally now only manage a ``unifiedTopology`` when you connect
730746
to a ``mongod``. The differences between this and previous versions
@@ -736,13 +752,13 @@ Unified Topology
736752
to connect to uninitialized replica set members.
737753

738754
Explain
739-
+++++++
755+
```````
740756

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

744760
Command Monitoring
745-
++++++++++++++++++
761+
``````````````````
746762

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

0 commit comments

Comments
 (0)