|
| 1 | +.. _kafka-mongodb-aws: |
| 2 | + |
1 | 3 | ================================ |
2 | 4 | MongoDB AWS-based Authentication |
3 | 5 | ================================ |
4 | 6 |
|
5 | | -TODO: |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 2 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +Overview |
| 16 | +-------- |
| 17 | + |
| 18 | +In this guide, you can learn how to authenticate your {+mkc+} with your |
| 19 | +MongoDB replica set using the ``MONGODB-AWS`` authentication mechanism. |
| 20 | +The ``MONGODB-AWS`` authentication mechanism uses your Amazon Web |
| 21 | +Services Identity and Access Management (AWS IAM) credentials to authenticate |
| 22 | +your user. |
| 23 | + |
| 24 | +To learn how to set up your MongoDB replica set in MongoDB Atlas to use |
| 25 | +AWS IAM credentials, see the guide on :atlas:`How to Set Up Unified AWS Access </security/set-up-unified-aws-access/>`. |
| 26 | + |
| 27 | +.. important:: |
| 28 | + |
| 29 | + You need to use {+mkc+} version 1.5 of later to connect to a MongoDB |
| 30 | + server set up to authenticate using your AWS IAM credentials. AWS IAM |
| 31 | + credential authentication is available in MongoDB server version 4.4 |
| 32 | + and later. |
| 33 | + |
| 34 | +Connector Connection Settings |
| 35 | +----------------------------- |
| 36 | + |
| 37 | +You can specify your ``MONGODB-AWS`` authentication credentials in your |
| 38 | +connection URI connector property as shown in the following example: |
| 39 | + |
| 40 | +.. code-block:: ini |
| 41 | + |
| 42 | + connection.uri="mongodb://<AWS access key id>:<AWS secret access key>@<hostname>:<port>/?authSource=<authentication database>&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<AWS session token>" |
| 43 | + |
| 44 | +The preceding example uses the following placeholders which you need to |
| 45 | +replace: |
| 46 | + |
| 47 | +.. list-table:: |
| 48 | + :header-rows: 1 |
| 49 | + :widths: 40 60 |
| 50 | + |
| 51 | + * - Placeholder |
| 52 | + - Description |
| 53 | + |
| 54 | + * - **AWS access key id** |
| 55 | + - Value of your ``AWS_ACCESS_KEY_ID``. |
| 56 | + |
| 57 | + * - **AWS secret access key** |
| 58 | + - Value of your ``AWS_SECRET_KEY``. |
| 59 | + |
| 60 | + * - **hostname** |
| 61 | + - Network address of your MongoDB server. |
| 62 | + |
| 63 | + * - **port** |
| 64 | + - Port number of your MongoDB server. |
| 65 | + |
| 66 | + * - **authentication database** |
| 67 | + - MongoDB database that contains your user's authentication data. If |
| 68 | + you omit the ``authSource`` parameter and placeholder value, the |
| 69 | + driver uses the default value ``admin``. |
| 70 | + |
| 71 | + * - **AWS session token** |
| 72 | + - | Value of your ``AWS_SESSION_TOKEN``. If you do not need to specify an |
| 73 | + AWS session token, omit the ``authMechanismProperties`` parameter |
| 74 | + and placeholder value. |
| 75 | + | *Optional* |
| 76 | + |
0 commit comments