Skip to content

Commit 97e7470

Browse files
authored
DOCSP-48942: add ARN env var assignment (#484)
* DOCSP-48942: add ARN env var assignment * small fixes * small fixes
1 parent e8c6de2 commit 97e7470

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

source/fundamentals/auth.txt

+27-19
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Authentication Mechanisms
55
=========================
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none
@@ -199,22 +197,23 @@ user.
199197
To connect to a MongoDB instance with ``MONGODB-AWS`` authentication enabled,
200198
specify the ``MONGODB-AWS`` authentication mechanism.
201199

202-
The driver checks for your credentials in the following sources in the order
203-
they are listed:
200+
The driver checks for your credentials in the following sources in the
201+
order listed:
204202

205-
1. Connection string
206-
#. Environment variables
207-
#. Web identity token file
208-
#. AWS ECS endpoint specified in the ``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI``
209-
environment variable
210-
#. AWS EC2 endpoint. For more information, see `IAM Roles for Tasks
211-
<https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`_.
203+
1. Connection string.
204+
#. Environment variables.
205+
#. Web identity token file.
206+
#. AWS ECS endpoint specified in the
207+
``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`` environment variable.
208+
#. AWS EC2 endpoint. To learn more, see `IAM Roles for Tasks
209+
<https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`__
210+
in the AWS documentation.
212211

213212
.. important::
214213

215214
The driver obtains the credentials only from the first source in which they are found.
216215
For example, if you specify your AWS credentials in the connection string, the
217-
driver ignores any credentials that you have specified in environment variables.
216+
driver ignores any credentials that you specify in environment variables.
218217

219218
.. tabs::
220219

@@ -273,17 +272,26 @@ they are listed:
273272
.. tab:: Web Identity Token File
274273
:tabid: web-identity-token-file
275274

276-
You can use the OpenID Connect (OIDC) token obtained from a web identity provider to authenticate
277-
to Amazon Elastic Kubernetes Service (EKS) or other services.
278-
To use an OIDC token, create a file that contains your token, then
279-
set the absolute path to this file in an environment variable by using
280-
a shell as shown in the following example:
275+
You can use the OpenID Connect (OIDC) token obtained from a web
276+
identity provider to authenticate to Amazon Elastic Kubernetes
277+
Service (EKS) or other services. To use an OIDC token, create or
278+
locate the file that contains your token. Then, set the following
279+
environment variables:
280+
281+
- ``AWS_WEB_IDENTITY_TOKEN_FILE``: Set to the absolute path of the
282+
file that contains your OIDC token.
283+
284+
- ``AWS_ROLE_ARN``: Set to the IAM role used to connect to your
285+
cluster. For example: ``arn:aws:iam::111122223333:role/my-role``.
286+
287+
The following shell command sets these environment variables:
281288

282289
.. code-block:: bash
283290

284-
export AWS_WEB_IDENTITY_TOKEN_FILE=<absolute path to file containing your OIDC token>
291+
export AWS_WEB_IDENTITY_TOKEN_FILE=<absolute path to file that contains OIDC token>
292+
export AWS_ROLE_ARN=<IAM role name>
285293

286-
After you've set the preceding environment variable, specify the ``MONGODB-AWS``
294+
After you set the preceding environment variables, specify the ``MONGODB-AWS``
287295
authentication mechanism as shown in the following example:
288296

289297
.. literalinclude:: /includes/fundamentals/code-snippets/authentication/aws-environment-variables.go

source/fundamentals/crud/read-operations.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Read Operations
1111
:caption: Read Operations
1212

1313
Query </fundamentals/crud/read-operations/query-document>
14+
Retrieve Data </fundamentals/crud/read-operations/retrieve>
1415
Count Documents </fundamentals/crud/read-operations/count>
1516
Data Cursors </fundamentals/crud/read-operations/cursor>
1617
Distinct Field Values </fundamentals/crud/read-operations/distinct>
@@ -22,8 +23,8 @@ Read Operations
2223
Monitor Data Changes </fundamentals/crud/read-operations/changestream>
2324

2425
- :ref:`golang-query-document`
25-
- :ref:`golang-count-documents`
2626
- :ref:`golang-retrieve`
27+
- :ref:`golang-count-documents`
2728
- :ref:`golang-cursor`
2829
- :ref:`golang-retrieve-distinct`
2930
- :ref:`golang-sort-results`

source/fundamentals/crud/read-operations/retrieve.txt

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Retrieve Data
55
==============
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none

source/usage-examples/count.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
.. _golang-count-usage-example:
22

3-
=============================
3+
==============================
44
Count Documents Method Example
5-
=============================
6-
7-
.. default-domain:: mongodb
5+
==============================
86

97
You can get an approximation on the number of documents in a
108
collection by using the ``EstimatedDocumentCount()`` method and an exact

0 commit comments

Comments
 (0)