Skip to content

Commit e7a5712

Browse files
authored
update auth_database_name (#299)
* update auth_database_name Missing add of $external, updated to match API docs. * Adding a few more docs changes link to privatelink example and add an example output to cluster.
1 parent 462f10f commit e7a5712

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

website/docs/d/database_users.html.markdown

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ In addition to all arguments above, the following attributes are exported:
6565
* `project_id` - ID of the Atlas project the user belongs to.
6666
* `username` - Username for authenticating to MongoDB.
6767
* `roles` - List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See [Roles](#roles) below for more details.
68-
* `auth_database_name` - The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is always the admin database.
68+
* `auth_database_name` - (Required) Database against which Atlas authenticates the user. A user must provide both a username and authentication database to log into MongoDB.
69+
Possible values include:
70+
* `admin` if `x509_type` and `aws_iam_type` are omitted or NONE.
71+
* `$external` if:
72+
* `x509_type` is MANAGED or CUSTOMER, or
73+
* `aws_iam_type` is USER or ROLE.
6974

7075
* `x509_type` - X.509 method by which the provided username is authenticated.
7176
* `aws_iam_type` - The new database user authenticates with AWS IAM credentials. Default is `NONE`, `USER` means user has AWS IAM user credentials, `ROLE` - means user has credentials associated with an AWS IAM role.

website/docs/index.html.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,9 @@ For more information on configuring and managing programmatic API Keys see the [
9494
[Request Features](https://feedback.mongodb.com/forums/924145-atlas?category_id=370723)
9595

9696
[Support](https://docs.atlas.mongodb.com/support/) covered by MongoDB Atlas support plans, Developer and above.
97+
98+
## Examples from the Community
99+
100+
Have a good example you've created and want to share? Let us know the details via an [issue](https://github.com/mongodb/terraform-provider-mongodbatlas/issues)
101+
102+
[Example - AWS and Atlas PrivateLink with Terraform](https://github.com/nikhil-mongo/aws-atlas-privatelink)

website/docs/r/cluster.html.markdown

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ resource "mongodbatlas_cluster" "cluster-test" {
188188
auto_scaling_disk_gb_enabled = "false"
189189
}
190190
```
191+
### Example - Return a Connection String
192+
```hcl
193+
output "plstring" {
194+
value = lookup(mongodbatlas_cluster.cluster-test.connection_strings[0].aws_private_link_srv, aws_vpc_endpoint.ptfe_service.id)
195+
}
196+
//Example return string: plstring = mongodb+srv://cluster-atlas-pl-0.za3fb.mongodb.net
197+
```
191198

192199
## Argument Reference
193200

website/docs/r/database_user.html.markdown

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ resource "mongodbatlas_database_user" "test" {
6464

6565
## Argument Reference
6666

67-
* `auth_database_name` - (Required) The user’s authentication database. A user must provide both a username and authentication database to log into MongoDB. In Atlas deployments of MongoDB, the authentication database is always the admin database.
67+
* `auth_database_name` - (Required) Database against which Atlas authenticates the user. A user must provide both a username and authentication database to log into MongoDB.
68+
Accepted values include:
69+
* `admin` if `x509_type` and `aws_iam_type` are omitted or NONE.
70+
* `$external` if:
71+
* `x509_type` is MANAGED or CUSTOMER, or
72+
* `aws_iam_type` is USER or ROLE.
6873
* `project_id` - (Required) The unique ID for the project to create the database user.
6974
* `roles` - (Required) List of user’s roles and the databases / collections on which the roles apply. A role allows the user to perform particular actions on the specified database. A role on the admin database can include privileges that apply to the other databases as well. See [Roles](#roles) below for more details.
7075
* `username` - (Required) Username for authenticating to MongoDB.

0 commit comments

Comments
 (0)