-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-48942: add ARN env var assignment #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
Authentication Mechanisms | ||
========================= | ||
|
||
.. default-domain:: mongodb | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
|
@@ -199,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: | ||
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. For more information, see `IAM Roles for Tasks | ||
<https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`_. | ||
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 | ||
<https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`__ | ||
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:: | ||
|
||
|
@@ -273,17 +272,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=<absolute path to file containing your OIDC token> | ||
export AWS_WEB_IDENTITY_TOKEN_FILE=<path to file that contains OIDC token> | ||
|
||
export AWS_ROLE_ARN=<IAM role name> | ||
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: comma splice