From 4aeb100c53bbe5779cbae6fe32949bfd4fc7f0bb Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 3 Apr 2025 16:24:36 -0400 Subject: [PATCH 1/3] DOCSP-48942: add ARN env var assignment --- source/fundamentals/auth.txt | 25 ++++++++++++------- source/fundamentals/crud/read-operations.txt | 3 ++- .../crud/read-operations/retrieve.txt | 2 -- source/usage-examples/count.txt | 6 ++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index 25f9ff06..fb4bda37 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -4,8 +4,6 @@ Authentication Mechanisms ========================= -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none @@ -273,17 +271,26 @@ they are listed: .. tab:: Web Identity Token File :tabid: web-identity-token-file - You can use the OpenID Connect (OIDC) token obtained from a web identity provider to authenticate - to Amazon Elastic Kubernetes Service (EKS) or other services. - To use an OIDC token, create a file that contains your token, then - set the absolute path to this file in an environment variable by using - a shell as shown in the following example: + You can use the OpenID Connect (OIDC) token obtained from a web + identity provider to authenticate to Amazon Elastic Kubernetes + Service (EKS) or other services. To use an OIDC token, create or + locate the file that contains your token. Then, set the following + environment variables: + + - ``AWS_WEB_IDENTITY_TOKEN_FILE``: Set to the absolute path of the + file that contains your OIDC token. + + - ``AWS_ROLE_ARN``: Set to the IAM role used to connect to your + cluster, for example ``arn:aws:iam::111122223333:role/my-role``. + + The following shell command sets these environment variables: .. code-block:: bash - export AWS_WEB_IDENTITY_TOKEN_FILE= + export AWS_WEB_IDENTITY_TOKEN_FILE= + export AWS_ROLE_ARN= - After you've set the preceding environment variable, specify the ``MONGODB-AWS`` + After you set the preceding environment variables, specify the ``MONGODB-AWS`` authentication mechanism as shown in the following example: .. literalinclude:: /includes/fundamentals/code-snippets/authentication/aws-environment-variables.go diff --git a/source/fundamentals/crud/read-operations.txt b/source/fundamentals/crud/read-operations.txt index 77116482..f4d0c19b 100644 --- a/source/fundamentals/crud/read-operations.txt +++ b/source/fundamentals/crud/read-operations.txt @@ -11,6 +11,7 @@ Read Operations :caption: Read Operations Query + Retrieve Data Count Documents Data Cursors Distinct Field Values @@ -22,8 +23,8 @@ Read Operations Monitor Data Changes - :ref:`golang-query-document` -- :ref:`golang-count-documents` - :ref:`golang-retrieve` +- :ref:`golang-count-documents` - :ref:`golang-cursor` - :ref:`golang-retrieve-distinct` - :ref:`golang-sort-results` diff --git a/source/fundamentals/crud/read-operations/retrieve.txt b/source/fundamentals/crud/read-operations/retrieve.txt index f0fe9e30..ded9cbdc 100644 --- a/source/fundamentals/crud/read-operations/retrieve.txt +++ b/source/fundamentals/crud/read-operations/retrieve.txt @@ -4,8 +4,6 @@ Retrieve Data ============== -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none diff --git a/source/usage-examples/count.txt b/source/usage-examples/count.txt index acf4659f..2167ebbc 100644 --- a/source/usage-examples/count.txt +++ b/source/usage-examples/count.txt @@ -1,10 +1,8 @@ .. _golang-count-usage-example: -============================= +============================== Count Documents Method Example -============================= - -.. default-domain:: mongodb +============================== You can get an approximation on the number of documents in a collection by using the ``EstimatedDocumentCount()`` method and an exact From 65cffbd8b5c51c245fbe6504f84d0e777d564ed0 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 3 Apr 2025 16:31:06 -0400 Subject: [PATCH 2/3] small fixes --- source/fundamentals/auth.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index fb4bda37..8a32ddbc 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -197,22 +197,23 @@ user. To connect to a MongoDB instance with ``MONGODB-AWS`` authentication enabled, specify the ``MONGODB-AWS`` authentication mechanism. -The driver checks for your credentials in the following sources in the order -they are listed: - -1. Connection string -#. Environment variables -#. Web identity token file -#. AWS ECS endpoint specified in the ``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`` - environment variable -#. AWS EC2 endpoint. For more information, see `IAM Roles for Tasks - `_. +The driver checks for your credentials in the following sources in the +order listed: + +1. Connection string. +#. Environment variables. +#. Web identity token file. +#. AWS ECS endpoint specified in the + ``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`` environment variable. +#. AWS EC2 endpoint. To learn more, see `IAM Roles for Tasks + `__ + in the AWS documentation. .. important:: The driver obtains the credentials only from the first source in which they are found. For example, if you specify your AWS credentials in the connection string, the - driver ignores any credentials that you have specified in environment variables. + driver ignores any credentials that you specify in environment variables. .. tabs:: From 897da4727760dac39a85cb8c29ebc5a62bf567eb Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 4 Apr 2025 09:35:29 -0400 Subject: [PATCH 3/3] small fixes --- source/fundamentals/auth.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index 8a32ddbc..cbe84f8d 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -282,13 +282,13 @@ order listed: file that contains your OIDC token. - ``AWS_ROLE_ARN``: Set to the IAM role used to connect to your - cluster, for example ``arn:aws:iam::111122223333:role/my-role``. + cluster. For example: ``arn:aws:iam::111122223333:role/my-role``. The following shell command sets these environment variables: .. code-block:: bash - export AWS_WEB_IDENTITY_TOKEN_FILE= + export AWS_WEB_IDENTITY_TOKEN_FILE= export AWS_ROLE_ARN= After you set the preceding environment variables, specify the ``MONGODB-AWS``