Show / Hide Table of Contents

Class X509AuthenticationDatabaseUser

mongodbatlas..X509AuthenticationDatabaseUser provides a X509 Authentication Database User resource. The mongodbatlas..X509AuthenticationDatabaseUser resource lets you manage MongoDB users who authenticate using X.509 certificates. You can manage these X.509 certificates or let Atlas do it for you.

Management Description
Atlas Atlas manages your Certificate Authority and can generate certificates for your MongoDB users. No additional X.509 configuration is required.
Customer You must provide a Certificate Authority and generate certificates for your MongoDB users.

NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.

Example Usages

Example Usage: Generate an Atlas-managed X.509 certificate for a MongoDB user

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var user = new Mongodbatlas.DatabaseUser("user", new Mongodbatlas.DatabaseUserArgs
    {
        DatabaseName = "$$external",
        Labels = 
        {
            new Mongodbatlas.Inputs.DatabaseUserLabelArgs
            {
                Key = "My Key",
                Value = "My Value",
            },
        },
        ProjectId = "<PROJECT-ID>",
        Roles = 
        {
            new Mongodbatlas.Inputs.DatabaseUserRoleArgs
            {
                DatabaseName = "admin",
                RoleName = "atlasAdmin",
            },
        },
        Username = "myUsername",
        X509Type = "MANAGED",
    });
    var test = new Mongodbatlas.X509AuthenticationDatabaseUser("test", new Mongodbatlas.X509AuthenticationDatabaseUserArgs
    {
        MonthsUntilExpiration = 2,
        ProjectId = user.ProjectId,
        Username = user.Username,
    });
}

}

Example Usage: Save a customer-managed X.509 configuration for an Atlas project

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.X509AuthenticationDatabaseUser("test", new Mongodbatlas.X509AuthenticationDatabaseUserArgs
    {
        CustomerX509Cas = @"  -----BEGIN CERTIFICATE-----
MIICmTCCAgICCQDZnHzklxsT9TANBgkqhkiG9w0BAQsFADCBkDELMAkGA1UEBhMC
VVMxDjAMBgNVBAgMBVRleGFzMQ8wDQYDVQQHDAZBdXN0aW4xETAPBgNVBAoMCHRl
c3QuY29tMQ0wCwYDVQQLDARUZXN0MREwDwYDVQQDDAh0ZXN0LmNvbTErMCkGCSqG
SIb3DQEJARYcbWVsaXNzYS5wbHVua2V0dEBtb25nb2RiLmNvbTAeFw0yMDAyMDQy
MDQ2MDFaFw0yMTAyMDMyMDQ2MDFaMIGQMQswCQYDVQQGEwJVUzEOMAwGA1UECAwF
VGV4YXMxDzANBgNVBAcMBkF1c3RpbjERMA8GA1UECgwIdGVzdC5jb20xDTALBgNV
BAsMBFRlc3QxETAPBgNVBAMMCHRlc3QuY29tMSswKQYJKoZIhvcNAQkBFhxtZWxp
c3NhLnBsdW5rZXR0QG1vbmdvZGIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
iQKBgQCf1LRqr1zftzdYx2Aj9G76tb0noMPtj6faGLlPji1+m6Rn7RWD9L0ntWAr
cURxvypa9jZ9MXFzDtLevvd3tHEmfrUT3ukNDX6+Jtc4kWm+Dh2A70Pd+deKZ2/O
Fh8audEKAESGXnTbeJCeQa1XKlIkjqQHBNwES5h1b9vJtFoLJwIDAQABMA0GCSqG
SIb3DQEBCwUAA4GBADMUncjEPV/MiZUcVNGmktP6BPmEqMXQWUDpdGW2+Tg2JtUA
7MMILtepBkFzLO+GlpZxeAlXO0wxiNgEmCRONgh4+t2w3e7a8GFijYQ99FHrAC5A
iul59bdl18gVqXia1Yeq/iK7Ohfy/Jwd7Hsm530elwkM/ZEkYDjBlZSXYdyz
-----END CERTIFICATE-----""

",
        ProjectId = "<PROJECT-ID>",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
X509AuthenticationDatabaseUser
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Mongodbatlas
Assembly: Pulumi.Mongodbatlas.dll
Syntax
public class X509AuthenticationDatabaseUser : CustomResource

Constructors

View Source

X509AuthenticationDatabaseUser(String, X509AuthenticationDatabaseUserArgs, CustomResourceOptions)

Create a X509AuthenticationDatabaseUser resource with the given unique name, arguments, and options.

Declaration
public X509AuthenticationDatabaseUser(string name, X509AuthenticationDatabaseUserArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

X509AuthenticationDatabaseUserArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Certificates

Array of objects where each details one unexpired database user certificate.

Declaration
public Output<ImmutableArray<X509AuthenticationDatabaseUserCertificate>> Certificates { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<X509AuthenticationDatabaseUserCertificate>>
View Source

CurrentCertificate

Contains the last X.509 certificate and private key created for a database user.

Declaration
public Output<string> CurrentCertificate { get; }
Property Value
Type Description
Output<System.String>
View Source

CustomerX509Cas

PEM string containing one or more customer CAs for database user authentication.

Declaration
public Output<string> CustomerX509Cas { get; }
Property Value
Type Description
Output<System.String>
View Source

MonthsUntilExpiration

A number of months that the created certificate is valid for before expiry, up to 24 months. By default is 3.

Declaration
public Output<int?> MonthsUntilExpiration { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ProjectId

Identifier for the Atlas project associated with the X.509 configuration.

Declaration
public Output<string> ProjectId { get; }
Property Value
Type Description
Output<System.String>
View Source

Username

Username of the database user to create a certificate for.

Declaration
public Output<string> Username { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, X509AuthenticationDatabaseUserState, CustomResourceOptions)

Get an existing X509AuthenticationDatabaseUser resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static X509AuthenticationDatabaseUser Get(string name, Input<string> id, X509AuthenticationDatabaseUserState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

X509AuthenticationDatabaseUserState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
X509AuthenticationDatabaseUser
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.