Skip to content

Commit b76fdb8

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 954990d commit b76fdb8

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

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

164164
- The driver no longer includes AWS SDK modules by default. Use the
165165
following ``npm`` command to install the SDK:
@@ -255,19 +255,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
255255
What's New in 4.11
256256
------------------
257257

258+
Prioritization Order in Monitoring
259+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260+
258261
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
259262
``electionId`` settings before ``setVersion`` settings during Server Discovery and
260263
Monitoring events. In previous versions, the prioritization order was reversed.
261264

262-
This release also includes added support for **mutually
265+
Changes to AWS Authentication
266+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267+
268+
When you install the optional ``aws-sdk/credential-providers``
269+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
270+
environment.
271+
272+
To learn more about this behavior, see the :ref:`MONGODB-AWS
273+
<mongodb-aws>` section of the Authentication Mechanisms guide.
274+
275+
Mutually Recursive Schema Type Checking
276+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277+
278+
This release includes added support for **mutually
263279
recursive** collection schema types. The driver also provides type safety for
264280
dot-notation queries up to a depth of eight in this release. At a depth greater
265281
than or equal to eight, Typescript successfully compiles your code but does not
266282
provide type safety. This depth limit on recursive types is a current limitation
267283
of TypeScript.
268284

269-
Mutually Recursive Schema Type Checking Example
270-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285+
Example
286+
```````
271287

272288
Suppose we have a collection of type ``Collection<Author>`` that contains the
273289
following mutually recursive types:
@@ -505,7 +521,7 @@ Key Changes
505521
~~~~~~~~~~~
506522

507523
Node.js Version
508-
+++++++++++++++
524+
```````````````
509525

510526
The minimum supported version of Node.js is now v12.9 or greater for
511527
version 4 of the driver. Support for our 3.x branches will continue
@@ -517,7 +533,7 @@ until summer 2022 to allow time to upgrade.
517533

518534

519535
Cursor Improvements
520-
+++++++++++++++++++
536+
```````````````````
521537

522538
Our Cursor implementation is now updated to make it clear what is possible
523539
before and after execution of an operation.
@@ -549,7 +565,7 @@ similar to the following:
549565
- ``ListCollectionsCursor``
550566

551567
Cursor Stream API
552-
^^^^^^^^^^^^^^^^^
568+
+++++++++++++++++
553569

554570
Our Cursor types no longer extend ``Readable`` directly. They must be
555571
transformed into a stream by calling ``cursor.stream()``.
@@ -569,7 +585,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
569585
asynchronous iteration.
570586

571587
``MongoClientOptions`` Interface
572-
+++++++++++++++++++++++++++++++++
588+
````````````````````````````````
573589

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

586602
``createCollection()``
587-
++++++++++++++++++++++
603+
``````````````````````
588604

589605
This method no longer supports a ``strict`` option, which returned
590606
an error if the collection did not exist. To assert the existence of
@@ -603,7 +619,7 @@ a collection, use the ``listCollections()`` method instead.
603619
}
604620

605621
``BulkWriteError`` → ``MongoBulkWriteError``
606-
++++++++++++++++++++++++++++++++++++++++++++
622+
````````````````````````````````````````````
607623

608624
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
609625

@@ -612,20 +628,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
612628
when testing for errors in bulk operations.
613629

614630
``DB``
615-
++++++
631+
``````
616632

617633
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
618634
``MongoClient`` instance.
619635

620636
``Collection.group()``
621-
++++++++++++++++++++++
637+
``````````````````````
622638

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

627643
Authentication
628-
++++++++++++++
644+
``````````````
629645

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

@@ -649,15 +665,15 @@ Authentication
649665
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
650666

651667
``GridStore`` Removal
652-
+++++++++++++++++++++
668+
`````````````````````
653669

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

657673
Below are some snippets that represent equivalent operations.
658674

659675
Construction
660-
^^^^^^^^^^^^
676+
++++++++++++
661677

662678
.. example::
663679

@@ -669,7 +685,7 @@ Construction
669685
const bucket = new GridFSBucket(client.db('test')[,options])
670686

671687
File Seeking
672-
^^^^^^^^^^^^
688+
++++++++++++
673689

674690
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
675691
by using the ``start`` and ``end`` options, creating a download stream
@@ -682,7 +698,7 @@ from your ``GridFSBucket``.
682698
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
683699

684700
File Upload & Download
685-
^^^^^^^^^^^^^^^^^^^^^^
701+
++++++++++++++++++++++
686702

687703
.. example::
688704

@@ -721,7 +737,7 @@ File Upload & Download
721737
``GridFSBucket`` does not need to be closed like ``GridStore``.
722738

723739
File Deletion
724-
^^^^^^^^^^^^^
740+
+++++++++++++
725741

726742
.. example::
727743

@@ -733,7 +749,7 @@ File Deletion
733749
bucket.delete(file_id);
734750

735751
Finding File Metadata
736-
^^^^^^^^^^^^^^^^^^^^^
752+
+++++++++++++++++++++
737753

738754
File metadata that used to be accessible on the ``GridStore`` instance can be
739755
found by querying the bucket.
@@ -745,7 +761,7 @@ found by querying the bucket.
745761
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
746762

747763
Unified Topology
748-
++++++++++++++++
764+
````````````````
749765

750766
- We internally now only manage a ``unifiedTopology`` when you connect
751767
to a ``mongod``. The differences between this and previous versions
@@ -757,13 +773,13 @@ Unified Topology
757773
to connect to uninitialized replica set members.
758774

759775
Explain
760-
+++++++
776+
```````
761777

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

765781
Command Monitoring
766-
++++++++++++++++++
782+
``````````````````
767783

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

0 commit comments

Comments
 (0)