mongocli atlas dbusers create
On this page
mongocli atlas
commands are now deprecated because there's a new, dedicated CLI available for Atlas users. Migrate to the Atlas CLI to enjoy the same capabilities and the latest features. You can use mongocli atlas
commands until April 30, 2023.Create a database user for your project.
Syntax
mongocli atlas dbusers create [options]
Options
Name | Type | Required | Description |
---|---|---|---|
--awsIAMType | string | false | AWS IAM method by which the provided username is authenticated. Valid values are NONE, USER, or ROLE. This value defaults to "NONE". |
--deleteAfter | string | false | Timestamp in ISO 8601 in UTC after which Atlas deletes the user. |
-h, --help | false | help for create | |
--ldapType | string | false | LDAP method by which the provided username is authenticated. Valid values are NONE, USER, or GROUP. This value defaults to "NONE". |
-o, --output | string | false | Output format. Valid values are json, json-path, go-template, or go-template-file. |
-p, --password | string | false | User's password. |
--projectId | string | false | Project ID to use. Overrides the settings in the configuration file or environment variable. |
--role | strings | false | User's roles and the databases or collections on which the roles apply. |
--scope | strings | false | Array of clusters and Atlas Data Lakes that this user has access to. |
-u, --username | string | true | Username for authenticating to MongoDB. |
--x509Type | string | false | X.509 method by which the provided username is authenticated. Valid values are NONE, MANAGED, or CUSTOMER. This value defaults to "NONE". |
Inherited Options
Name | Type | Required | Description |
---|---|---|---|
-P, --profile | string | false | Profile to use from your configuration file. |
Examples
Create an Atlas admin user $ mongocli atlas dbuser create atlasAdmin --username <username> --projectId <projectId> Create user with read/write access to any database $ mongocli atlas dbuser create readWriteAnyDatabase --username <username> --projectId <projectId> Create user with multiple roles $ mongocli atlas dbuser create --username <username> --role clusterMonitor,backup --projectId <projectId> Create user with multiple scopes $ mongocli atlas dbuser create --username <username> --role clusterMonitor --scope clusterName:CLUSTER,DataLakeName:DATA_LAKE --projectId <projectId>