From 059aff9610583f224bcdc3925646175aafa2e5d8 Mon Sep 17 00:00:00 2001 From: andreaangiolillo Date: Thu, 20 Jul 2023 14:54:25 +0200 Subject: [PATCH] Update x509_authentication_database_user.html.markdown --- ...authentication_database_user.html.markdown | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/website/docs/r/x509_authentication_database_user.html.markdown b/website/docs/r/x509_authentication_database_user.html.markdown index 43ed82fe34..4973936c1e 100644 --- a/website/docs/r/x509_authentication_database_user.html.markdown +++ b/website/docs/r/x509_authentication_database_user.html.markdown @@ -22,7 +22,7 @@ description: |- ### Example Usage: Generate an Atlas-managed X.509 certificate for a MongoDB user ```terraform resource "mongodbatlas_database_user" "user" { - project_id = "" + project_id = "64b926dd56206839b1c8bae9" username = "myUsername" x509_type = "MANAGED" database_name = "$external" @@ -45,7 +45,7 @@ resource "mongodbatlas_x509_authentication_database_user" "test" { } ``` -### Example Usage: Save a customer-managed X.509 configuration for an Atlas project +### Example Usage: Save a self-managed X.509 certificate for an Atlas project and use it with a dababase user ```terraform resource "mongodbatlas_x509_authentication_database_user" "test" { project_id = "" @@ -68,6 +68,23 @@ resource "mongodbatlas_x509_authentication_database_user" "test" { -----END CERTIFICATE-----" EOT } + +resource "mongodbatlas_database_user" "user" { + project_id = "64b926dd56206839b1c8bae9" + username = "myUsername" + x509_type = "CUSTOMER" # Make sure to set x509_type = "CUSTOMER" + database_name = "$external" + + roles { + role_name = "atlasAdmin" + database_name = "admin" + } + + labels { + key = "My Key" + value = "My Value" + } +} ``` ## Argument Reference