Skip to content

Commit 5bcdb61

Browse files
authored
DOCSP-26403: changes to aws credential retrieval (#691)
* DOCSP-26403: changes to aws credential retrieval * formatting fixes * capitalization * DB PR fixes 1
1 parent b6ce1c0 commit 5bcdb61

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

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

179179
- The driver no longer includes AWS SDK modules by default. Use the
180180
following ``npm`` command to install the SDK:
@@ -270,19 +270,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
270270
What's New in 4.11
271271
------------------
272272

273+
Prioritization Order in Monitoring
274+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275+
273276
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
274277
``electionId`` settings before ``setVersion`` settings during Server Discovery and
275278
Monitoring events. In previous versions, the prioritization order was reversed.
276279

277-
This release also includes added support for **mutually
280+
Changes to AWS Authentication
281+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282+
283+
When you install the optional ``aws-sdk/credential-providers``
284+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
285+
environment.
286+
287+
To learn more about this behavior, see the :ref:`MONGODB-AWS
288+
<mongodb-aws>` section of the Authentication Mechanisms guide.
289+
290+
Mutually Recursive Schema Type Checking
291+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
292+
293+
This release includes added support for **mutually
278294
recursive** collection schema types. The driver also provides type safety for
279295
dot-notation queries up to a depth of eight in this release. At a depth greater
280296
than or equal to eight, Typescript successfully compiles your code but does not
281297
provide type safety. This depth limit on recursive types is a current limitation
282298
of TypeScript.
283299

284-
Mutually Recursive Schema Type Checking Example
285-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300+
Example
301+
```````
286302

287303
Suppose we have a collection of type ``Collection<Author>`` that contains the
288304
following mutually recursive types:
@@ -520,7 +536,7 @@ Key Changes
520536
~~~~~~~~~~~
521537

522538
Node.js Version
523-
+++++++++++++++
539+
```````````````
524540

525541
The minimum supported version of Node.js is now v12.9 or greater for
526542
version 4 of the driver. Support for our 3.x branches will continue
@@ -532,7 +548,7 @@ until summer 2022 to allow time to upgrade.
532548

533549

534550
Cursor Improvements
535-
+++++++++++++++++++
551+
```````````````````
536552

537553
Our Cursor implementation is now updated to make it clear what is possible
538554
before and after execution of an operation.
@@ -564,7 +580,7 @@ similar to the following:
564580
- ``ListCollectionsCursor``
565581

566582
Cursor Stream API
567-
^^^^^^^^^^^^^^^^^
583+
+++++++++++++++++
568584

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

586602
``MongoClientOptions`` Interface
587-
+++++++++++++++++++++++++++++++++
603+
````````````````````````````````
588604

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

601617
``createCollection()``
602-
++++++++++++++++++++++
618+
``````````````````````
603619

604620
This method no longer supports a ``strict`` option, which returned
605621
an error if the collection did not exist. To assert the existence of
@@ -618,7 +634,7 @@ a collection, use the ``listCollections()`` method instead.
618634
}
619635

620636
``BulkWriteError`` → ``MongoBulkWriteError``
621-
++++++++++++++++++++++++++++++++++++++++++++
637+
````````````````````````````````````````````
622638

623639
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
624640

@@ -627,20 +643,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
627643
when testing for errors in bulk operations.
628644

629645
``DB``
630-
++++++
646+
``````
631647

632648
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
633649
``MongoClient`` instance.
634650

635651
``Collection.group()``
636-
++++++++++++++++++++++
652+
``````````````````````
637653

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

642658
Authentication
643-
++++++++++++++
659+
``````````````
644660

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

@@ -664,15 +680,15 @@ Authentication
664680
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
665681

666682
``GridStore`` Removal
667-
+++++++++++++++++++++
683+
`````````````````````
668684

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

672688
Below are some snippets that represent equivalent operations.
673689

674690
Construction
675-
^^^^^^^^^^^^
691+
++++++++++++
676692

677693
.. example::
678694

@@ -684,7 +700,7 @@ Construction
684700
const bucket = new GridFSBucket(client.db('test')[,options])
685701

686702
File Seeking
687-
^^^^^^^^^^^^
703+
++++++++++++
688704

689705
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
690706
by using the ``start`` and ``end`` options, creating a download stream
@@ -697,7 +713,7 @@ from your ``GridFSBucket``.
697713
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
698714

699715
File Upload & Download
700-
^^^^^^^^^^^^^^^^^^^^^^
716+
++++++++++++++++++++++
701717

702718
.. example::
703719

@@ -736,7 +752,7 @@ File Upload & Download
736752
``GridFSBucket`` does not need to be closed like ``GridStore``.
737753

738754
File Deletion
739-
^^^^^^^^^^^^^
755+
+++++++++++++
740756

741757
.. example::
742758

@@ -748,7 +764,7 @@ File Deletion
748764
bucket.delete(file_id);
749765

750766
Finding File Metadata
751-
^^^^^^^^^^^^^^^^^^^^^
767+
+++++++++++++++++++++
752768

753769
File metadata that used to be accessible on the ``GridStore`` instance can be
754770
found by querying the bucket.
@@ -760,7 +776,7 @@ found by querying the bucket.
760776
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
761777

762778
Unified Topology
763-
++++++++++++++++
779+
````````````````
764780

765781
- We internally now only manage a ``unifiedTopology`` when you connect
766782
to a ``mongod``. The differences between this and previous versions
@@ -772,13 +788,13 @@ Unified Topology
772788
to connect to uninitialized replica set members.
773789

774790
Explain
775-
+++++++
791+
```````
776792

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

780796
Command Monitoring
781-
++++++++++++++++++
797+
``````````````````
782798

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

0 commit comments

Comments
 (0)