@@ -28,12 +28,13 @@ Syntax
28
28
mongocli atlas dbuser create
29
29
--username|-u <name-of-user>
30
30
[ --output|-o <output-format> ]
31
- --password|-p <password-of-user>
31
+ [ --password|-p <password-of-user> ]
32
32
[ --profile|-P <profile-name> ]
33
33
[ --projectId <project-ID> ]
34
34
--role <name-of-role>
35
- [ --authDB <authentication-database> ]
36
35
[ --deleteAfter <date-of-deletion> ]
36
+ [ --x509Type <NONE|MANAGED|CUSTOMER> ]
37
+ [ --awsIAMType <NONE|USER|ROLE> ]
37
38
38
39
.. include:: /includes/fact-command-line-help.rst
39
40
@@ -58,12 +59,28 @@ Options
58
59
59
60
* - ``--username``, ``-u``
60
61
- string
61
- - Username for authenticating the user to MongoDB.
62
+ - Username for authenticating the user to MongoDB.
63
+
64
+ Must be a fully qualified distinguished name, as defined in `RFC
65
+ 2253 <https://tools.ietf.org/html/rfc2253.html>`__, if:
66
+
67
+ - ``--x509Type`` is ``CUSTOMER``.
68
+
69
+ Must be an `Amazon Resource Name (ARN)
70
+ <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ if:
71
+
72
+ - ``--awsIAMType`` is ``USER`` or ``ROLE``.
73
+
62
74
- yes
63
75
64
76
* - ``--password``, ``-p``
65
77
- string
66
- - Password for authenticating the user to MongoDB.
78
+ - Password for authenticating the user to MongoDB. Required if:
79
+
80
+ - ``--x509Type`` and ``--awsIAMType`` are omitted or ``NONE``,
81
+ meaning that the database user authenticates with
82
+ ``SCRAM-SHA``.
83
+
67
84
- no
68
85
69
86
* - ``--profile``, ``-P``
@@ -91,11 +108,6 @@ Options
91
108
</security-add-mongodb-users/index.html#mongodb-database-user-privileges>`.
92
109
- yes
93
110
94
- * - ``--authDB``
95
- - string
96
- - Name of the authentication database. Defaults to ``admin``.
97
- - no
98
-
99
111
* - ``--deleteAfter``
100
112
- date
101
113
- |iso8601-time| after which |service| deletes the user. The
@@ -118,6 +130,50 @@ Options
118
130
--deleteAfter 2020-08-01T12:30-04:00
119
131
- no
120
132
133
+ * - ``--x509Type``
134
+ - string
135
+ - X.509 method by which the provided username is authenticated.
136
+
137
+ Accepted values are:
138
+
139
+ - ``NONE``: User doesn't authenticate with X.509.
140
+ - ``MANAGED``: User authenticates with |service|-managed X.509.
141
+ You do not need to provide a ``--password`` for the user.
142
+ - ``CUSTOMER``: User authenticates with :atlas:`self-managed
143
+ X.509 </security-self-managed-x509/#self-managed-x509>`.
144
+ You do not need to provide a ``--password`` for the user. You
145
+ must include a fully qualified Distinguished Name (DN) as the
146
+ ``--username`` for users who authenticate with self-managed
147
+ X.509.
148
+
149
+ If no value is given, |service| uses the default value of
150
+ ``NONE``. You receive an error if the value is ``MANAGED`` or
151
+ ``CUSTOMER`` and ``--awsIAMType`` is ``USER`` or ``ROLE``.
152
+
153
+ - no
154
+
155
+ * - ``--awsIAMType``
156
+ - string
157
+ - If this value is set, the new database user authenticates with
158
+ |aws| IAM credentials.
159
+
160
+ Accepted values are:
161
+
162
+ - ``NONE``: User doesn't authenticate with AWS IAM credentials.
163
+ - ``USER``: User authenticates with :atlas:`AWS IAM user
164
+ credentials
165
+ </security-add-mongodb-users/#database-user-authentication>`.
166
+ You do not need to provide a ``--password`` for the user.
167
+ - ``ROLE``: User authenticates with :atlas:`AWS IAM role
168
+ credentials
169
+ </security-add-mongodb-users/#database-user-authentication>`.
170
+ You do not need to provide a ``--password`` for the user.
171
+
172
+ If no value is given, |service| uses the default value of
173
+ ``NONE``. You receive an error if the value is ``USER`` or
174
+ ``ROLE`` and ``--x509Type`` is ``MANAGED`` or ``CUSTOMER``.
175
+ - no
176
+
121
177
.. _dbuser-create-command-output:
122
178
123
179
Output
@@ -165,15 +221,17 @@ to the terminal. To learn more about these fields, see
165
221
:copyable: false
166
222
167
223
{
168
- "roles": [{
169
- "roleName": "atlasAdmin",
170
- "databaseName": "admin"
171
- }],
172
- "groupId": "5e2211c17a3e5a48f5497de3",
173
- "username": "user1",
174
- "databaseName": "admin",
175
- "ldapAuthType": "NONE"
176
- }
224
+ "roles": [{
225
+ "roleName": "atlasAdmin",
226
+ "databaseName": "admin"
227
+ }],
228
+ "groupId": "5e2211c17a3e5a48f5497de3",
229
+ "username": "user1",
230
+ "databaseName": "admin",
231
+ "ldapAuthType": "NONE",
232
+ "x509Type": "NONE",
233
+ "awsIAMType": "NONE"
234
+ }
177
235
178
236
.. _dbuser-create-eg-2:
179
237
@@ -209,19 +267,22 @@ To learn more about these fields, see :ref:`Output
209
267
:copyable: false
210
268
211
269
{
212
- "roles": [{
213
- "roleName": "readWriteAnyDatabase",
214
- "databaseName": "admin"
215
- },
216
- {
217
- "roleName": "clusterMonitor",
218
- "databaseName": "admin"
219
- }],
220
- "groupId": "5e2211c17a3e5a48f5497de3",
221
- "username": "egUser",
222
- "databaseName": "admin",
223
- "ldapAuthType": "NONE"
224
- }
270
+ "roles": [{
271
+ "roleName": "readWriteAnyDatabase",
272
+ "databaseName": "admin"
273
+ },
274
+ {
275
+ "roleName": "clusterMonitor",
276
+ "databaseName": "admin"
277
+ }
278
+ ],
279
+ "groupId": "5e2211c17a3e5a48f5497de3",
280
+ "username": "egUser",
281
+ "databaseName": "admin",
282
+ "ldapAuthType": "NONE",
283
+ "x509Type": "NONE",
284
+ "awsIAMType": "NONE"
285
+ }
225
286
226
287
.. _dbuser-create-eg-3:
227
288
@@ -252,15 +313,15 @@ to the terminal. To learn more about these fields, see
252
313
:copyable: false
253
314
254
315
{
255
- "roles": [{
256
- "roleName": "clusterMonitor",
257
- "databaseName": "admin"
258
- }],
259
- "groupId": "5e2211c17a3e5a48f5497de3",
260
- "username": "tempUser",
261
- "databaseName": "admin",
262
- "ldapAuthType": "NONE",
263
- "x509Type": "NONE",
264
- "awsIAMType": "NONE",
265
- "deleteAfterDate": "2020-07-31T00:00:00Z"
316
+ "roles": [{
317
+ "roleName": "clusterMonitor",
318
+ "databaseName": "admin"
319
+ }],
320
+ "groupId": "5e2211c17a3e5a48f5497de3",
321
+ "username": "tempUser",
322
+ "databaseName": "admin",
323
+ "ldapAuthType": "NONE",
324
+ "x509Type": "NONE",
325
+ "awsIAMType": "NONE",
326
+ "deleteAfterDate": "2020-07-31T00:00:00Z"
266
327
}
0 commit comments