Show / Hide Table of Contents

Namespace Pulumi.Mongodbatlas

Classes

AlertConfiguration

mongodbatlas..AlertConfiguration provides an Alert Configuration resource to define the conditions that trigger an alert and the methods of notification within a MongoDB Atlas project.

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.AlertConfiguration("test", new Mongodbatlas.AlertConfigurationArgs
    {
        Enabled = true,
        EventType = "OUTSIDE_METRIC_THRESHOLD",
        Matchers = 
        {
            new Mongodbatlas.Inputs.AlertConfigurationMatcherArgs
            {
                FieldName = "HOSTNAME_AND_PORT",
                Operator = "EQUALS",
                Value = "SECONDARY",
            },
        },
        MetricThreshold = new Mongodbatlas.Inputs.AlertConfigurationMetricThresholdArgs
        {
            Metric_name = "ASSERT_REGULAR",
            Mode = "AVERAGE",
            Operator = "LESS_THAN",
            Threshold = 99,
            Units = "RAW",
        },
        Notifications = 
        {
            new Mongodbatlas.Inputs.AlertConfigurationNotificationArgs
            {
                DelayMin = 0,
                EmailEnabled = true,
                IntervalMin = 5,
                Roles = 
                {
                    "GROUP_CHARTS_ADMIN",
                    "GROUP_CLUSTER_MANAGER",
                },
                SmsEnabled = false,
                TypeName = "GROUP",
            },
        },
        ProjectId = "<PROJECT-ID>",
    });
}

}

AlertConfigurationArgs

AlertConfigurationState

Auditing

mongodbatlas..Auditing provides an Auditing resource. This allows auditing to be created.

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.Auditing("test", new Mongodbatlas.AuditingArgs
    {
        AuditAuthorizationSuccess = false,
        AuditFilter = "{ 'atype': 'authenticate', 'param': {   'user': 'auditAdmin',   'db': 'admin',   'mechanism': 'SCRAM-SHA-1' }}",
        Enabled = true,
        ProjectId = "<project-id>",
    });
}

}

AuditingArgs

AuditingState

CloudProviderSnapshot

mongodbatlas..CloudProviderSnapshot provides a resource to take a cloud provider snapshot on demand. On-demand snapshots happen immediately, unlike scheduled snapshots which occur at regular intervals. If there is already an on-demand snapshot with a status of queued or inProgress, you must wait until Atlas has completed the on-demand snapshot before taking another.

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var myCluster = new Mongodbatlas.Cluster("myCluster", new Mongodbatlas.ClusterArgs
    {
        ProjectId = "5cf5a45a9ccf6400e60981b6",
        DiskSizeGb = 5,
        ProviderName = "AWS",
        ProviderRegionName = "EU_WEST_2",
        ProviderInstanceSizeName = "M10",
        ProviderBackupEnabled = true,
        ProviderDiskIops = 100,
        ProviderEncryptEbsVolume = false,
    });
    var testCloudProviderSnapshot = new Mongodbatlas.CloudProviderSnapshot("testCloudProviderSnapshot", new Mongodbatlas.CloudProviderSnapshotArgs
    {
        ProjectId = myCluster.ProjectId,
        ClusterName = myCluster.Name,
        Description = "myDescription",
        RetentionInDays = 1,
    });
    var testCloudProviderSnapshotRestoreJob = new Mongodbatlas.CloudProviderSnapshotRestoreJob("testCloudProviderSnapshotRestoreJob", new Mongodbatlas.CloudProviderSnapshotRestoreJobArgs
    {
        ProjectId = testCloudProviderSnapshot.ProjectId,
        ClusterName = testCloudProviderSnapshot.ClusterName,
        SnapshotId = testCloudProviderSnapshot.SnapshotId,
        DeliveryType = new Mongodbatlas.Inputs.CloudProviderSnapshotRestoreJobDeliveryTypeArgs
        {
            Download = true,
        },
    });
}

}

CloudProviderSnapshotArgs

CloudProviderSnapshotBackupPolicy

mongodbatlas..CloudProviderSnapshotBackupPolicy provides a resource that enables you to view and modify the snapshot schedule and retention settings for an Atlas cluster with Cloud Provider Snapshots enabled.

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var myCluster = new Mongodbatlas.Cluster("myCluster", new Mongodbatlas.ClusterArgs
    {
        ProjectId = "<PROJECT-ID>",
        DiskSizeGb = 5,
        ProviderName = "AWS",
        ProviderRegionName = "EU_CENTRAL_1",
        ProviderInstanceSizeName = "M10",
        ProviderBackupEnabled = true,
        ProviderDiskIops = 100,
        ProviderEncryptEbsVolume = false,
    });
    var test = new Mongodbatlas.CloudProviderSnapshotBackupPolicy("test", new Mongodbatlas.CloudProviderSnapshotBackupPolicyArgs
    {
        ProjectId = myCluster.ProjectId,
        ClusterName = myCluster.Name,
        ReferenceHourOfDay = 3,
        ReferenceMinuteOfHour = 45,
        RestoreWindowDays = 4,
        Policies = 
        {
            new Mongodbatlas.Inputs.CloudProviderSnapshotBackupPolicyPolicyArgs
            {
                Id = myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.Id),
                Policy_item = 
                {

                    {
                        { "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[0]?.Id) },
                        { "frequencyInterval", 1 },
                        { "frequencyType", "hourly" },
                        { "retentionUnit", "days" },
                        { "retentionValue", 1 },
                    },

                    {
                        { "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[1]?.Id) },
                        { "frequencyInterval", 1 },
                        { "frequencyType", "daily" },
                        { "retentionUnit", "days" },
                        { "retentionValue", 2 },
                    },

                    {
                        { "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[2]?.Id) },
                        { "frequencyInterval", 4 },
                        { "frequencyType", "weekly" },
                        { "retentionUnit", "weeks" },
                        { "retentionValue", 3 },
                    },

                    {
                        { "id", myCluster.SnapshotBackupPolicies.Apply(snapshotBackupPolicies => snapshotBackupPolicies[0].Policies?[0]?.PolicyItems?[3]?.Id) },
                        { "frequencyInterval", 5 },
                        { "frequencyType", "monthly" },
                        { "retentionUnit", "months" },
                        { "retentionValue", 4 },
                    },
                },
            },
        },
    });
}

}

CloudProviderSnapshotBackupPolicyArgs

CloudProviderSnapshotBackupPolicyState

CloudProviderSnapshotRestoreJob

mongodbatlas..CloudProviderSnapshotRestoreJob provides a resource to create a new restore job from a cloud provider snapshot of a specified cluster. The restore job can be one of two types:

  • automated: Atlas automatically restores the snapshot with snapshotId to the Atlas cluster with name targetClusterName in the Atlas project with targetGroupId.

  • download: Atlas provides a URL to download a .tar.gz of the snapshot with snapshotId. The contents of the archive contain the data files for your Atlas cluster.

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

Example Usage

Example automated delivery type.

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var myCluster = new Mongodbatlas.Cluster("myCluster", new Mongodbatlas.ClusterArgs
    {
        ProjectId = "5cf5a45a9ccf6400e60981b6",
        DiskSizeGb = 5,
        ProviderName = "AWS",
        ProviderRegionName = "EU_WEST_2",
        ProviderInstanceSizeName = "M10",
        ProviderBackupEnabled = true,
        ProviderDiskIops = 100,
        ProviderEncryptEbsVolume = false,
    });
    var testCloudProviderSnapshot = new Mongodbatlas.CloudProviderSnapshot("testCloudProviderSnapshot", new Mongodbatlas.CloudProviderSnapshotArgs
    {
        ProjectId = myCluster.ProjectId,
        ClusterName = myCluster.Name,
        Description = "myDescription",
        RetentionInDays = 1,
    });
    var testCloudProviderSnapshotRestoreJob = new Mongodbatlas.CloudProviderSnapshotRestoreJob("testCloudProviderSnapshotRestoreJob", new Mongodbatlas.CloudProviderSnapshotRestoreJobArgs
    {
        ProjectId = testCloudProviderSnapshot.ProjectId,
        ClusterName = testCloudProviderSnapshot.ClusterName,
        SnapshotId = testCloudProviderSnapshot.SnapshotId,
        DeliveryType = new Mongodbatlas.Inputs.CloudProviderSnapshotRestoreJobDeliveryTypeArgs
        {
            Automated = true,
            Target_cluster_name = "MyCluster",
            Target_project_id = "5cf5a45a9ccf6400e60981b6",
        },
    });
}

}

Example download delivery type.

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var myCluster = new Mongodbatlas.Cluster("myCluster", new Mongodbatlas.ClusterArgs
    {
        ProjectId = "5cf5a45a9ccf6400e60981b6",
        DiskSizeGb = 5,
        ProviderName = "AWS",
        ProviderRegionName = "EU_WEST_2",
        ProviderInstanceSizeName = "M10",
        ProviderBackupEnabled = true,
        ProviderDiskIops = 100,
        ProviderEncryptEbsVolume = false,
    });
    var testCloudProviderSnapshot = new Mongodbatlas.CloudProviderSnapshot("testCloudProviderSnapshot", new Mongodbatlas.CloudProviderSnapshotArgs
    {
        ProjectId = myCluster.ProjectId,
        ClusterName = myCluster.Name,
        Description = "myDescription",
        RetentionInDays = 1,
    });
    var testCloudProviderSnapshotRestoreJob = new Mongodbatlas.CloudProviderSnapshotRestoreJob("testCloudProviderSnapshotRestoreJob", new Mongodbatlas.CloudProviderSnapshotRestoreJobArgs
    {
        ProjectId = testCloudProviderSnapshot.ProjectId,
        ClusterName = testCloudProviderSnapshot.ClusterName,
        SnapshotId = testCloudProviderSnapshot.SnapshotId,
        DeliveryType = new Mongodbatlas.Inputs.CloudProviderSnapshotRestoreJobDeliveryTypeArgs
        {
            Download = true,
        },
    });
}

}

CloudProviderSnapshotRestoreJobArgs

CloudProviderSnapshotRestoreJobState

CloudProviderSnapshotState

Cluster

mongodbatlas..Cluster provides a Cluster resource. The resource lets you create, edit and delete clusters. The resource requires your Project ID.

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

IMPORTANT: <br> &#8226; Free tier cluster creation (M0) is not supported via API or by this Provider. <br> &#8226; Shared tier clusters (M2, M5) cannot be upgraded to higher tiers via API or by this Provider. <br> &#8226; Changes to cluster configurations can affect costs. Before making changes, please see Billing. <br> &#8226; If your Atlas project contains a custom role that uses actions introduced in a specific MongoDB version, you cannot create a cluster with a MongoDB version less than that version unless you delete the custom role.

Example Usage

Example AWS cluster

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var cluster_test = new Mongodbatlas.Cluster(&quot;cluster-test&quot;, new Mongodbatlas.ClusterArgs
    {
        AutoScalingDiskGbEnabled = true,
        DiskSizeGb = 100,
        MongoDbMajorVersion = &quot;4.0&quot;,
        NumShards = 1,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderBackupEnabled = true,
        ProviderDiskIops = 300,
        ProviderEncryptEbsVolume = true,
        ProviderInstanceSizeName = &quot;M40&quot;,
        ProviderName = &quot;AWS&quot;,
        ProviderRegionName = &quot;US_EAST_1&quot;,
        ProviderVolumeType = &quot;STANDARD&quot;,
        ReplicationFactor = 3,
    });
}

}

Example Azure cluster.

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.Cluster(&quot;test&quot;, new Mongodbatlas.ClusterArgs
    {
        AutoScalingDiskGbEnabled = true,
        MongoDbMajorVersion = &quot;4.0&quot;,
        NumShards = 1,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderBackupEnabled = true,
        ProviderDiskTypeName = &quot;P6&quot;,
        ProviderInstanceSizeName = &quot;M30&quot;,
        ProviderName = &quot;AZURE&quot;,
        ProviderRegionName = &quot;US_EAST_2&quot;,
        ReplicationFactor = 3,
    });
}

}

Example GCP cluster

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.Cluster(&quot;test&quot;, new Mongodbatlas.ClusterArgs
    {
        AutoScalingDiskGbEnabled = true,
        DiskSizeGb = 40,
        MongoDbMajorVersion = &quot;4.0&quot;,
        NumShards = 1,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderBackupEnabled = true,
        ProviderInstanceSizeName = &quot;M30&quot;,
        ProviderName = &quot;GCP&quot;,
        ProviderRegionName = &quot;US_EAST_4&quot;,
        ReplicationFactor = 3,
    });
}

}

Example Multi Region cluster

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var cluster_test = new Mongodbatlas.Cluster(&quot;cluster-test&quot;, new Mongodbatlas.ClusterArgs
    {
        ClusterType = &quot;REPLICASET&quot;,
        DiskSizeGb = 100,
        NumShards = 1,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderBackupEnabled = true,
        ProviderDiskIops = 300,
        ProviderInstanceSizeName = &quot;M10&quot;,
        ProviderName = &quot;AWS&quot;,
        ProviderVolumeType = &quot;STANDARD&quot;,
        ReplicationSpecs = 
        {
            new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
            {
                NumShards = 1,
                RegionsConfig = 
                {

                    {
                        { &quot;electableNodes&quot;, 3 },
                        { &quot;priority&quot;, 7 },
                        { &quot;readOnlyNodes&quot;, 0 },
                        { &quot;regionName&quot;, &quot;US_EAST_1&quot; },
                    },

                    {
                        { &quot;electableNodes&quot;, 2 },
                        { &quot;priority&quot;, 6 },
                        { &quot;readOnlyNodes&quot;, 0 },
                        { &quot;regionName&quot;, &quot;US_EAST_2&quot; },
                    },

                    {
                        { &quot;electableNodes&quot;, 2 },
                        { &quot;priority&quot;, 5 },
                        { &quot;readOnlyNodes&quot;, 2 },
                        { &quot;regionName&quot;, &quot;US_WEST_1&quot; },
                    },
                },
            },
        },
    });
}

}

Example Global cluster

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var cluster_test = new Mongodbatlas.Cluster(&quot;cluster-test&quot;, new Mongodbatlas.ClusterArgs
    {
        ClusterType = &quot;GEOSHARDED&quot;,
        DiskSizeGb = 80,
        NumShards = 1,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderBackupEnabled = true,
        ProviderDiskIops = 240,
        ProviderInstanceSizeName = &quot;M30&quot;,
        ProviderName = &quot;AWS&quot;,
        ProviderVolumeType = &quot;STANDARD&quot;,
        ReplicationSpecs = 
        {
            new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
            {
                NumShards = 2,
                RegionsConfig = 
                {

                    {
                        { &quot;electableNodes&quot;, 3 },
                        { &quot;priority&quot;, 7 },
                        { &quot;readOnlyNodes&quot;, 0 },
                        { &quot;regionName&quot;, &quot;US_EAST_1&quot; },
                    },
                },
                ZoneName = &quot;Zone 1&quot;,
            },
            new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
            {
                NumShards = 2,
                RegionsConfig = 
                {

                    {
                        { &quot;electableNodes&quot;, 3 },
                        { &quot;priority&quot;, 7 },
                        { &quot;readOnlyNodes&quot;, 0 },
                        { &quot;regionName&quot;, &quot;EU_CENTRAL_1&quot; },
                    },
                },
                ZoneName = &quot;Zone 2&quot;,
            },
        },
    });
}

}

Example AWS Shared Tier cluster

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var cluster_test = new Mongodbatlas.Cluster(&quot;cluster-test&quot;, new Mongodbatlas.ClusterArgs
    {
        AutoScalingDiskGbEnabled = &quot;false&quot;,
        BackingProviderName = &quot;AWS&quot;,
        DiskSizeGb = &quot;2&quot;,
        MongoDbMajorVersion = &quot;4.2&quot;,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderInstanceSizeName = &quot;M2&quot;,
        ProviderName = &quot;TENANT&quot;,
        ProviderRegionName = &quot;US_EAST_1&quot;,
    });
}

}

ClusterArgs

ClusterState

Config

CustomDbRole

mongodbatlas..CustomDbRole provides a Custom DB Role resource. The customDBRoles resource lets you retrieve, create and modify the custom MongoDB roles in your cluster. Use custom MongoDB roles to specify custom sets of actions which cannot be described by the built-in Atlas database user privileges.

IMPORTANT Custom roles cannot use actions unavailable to any cluster version in your project. Custom roles are defined at the project level, and must be compatible with each MongoDB version used by your project’s clusters. If you have a cluster in your project with MongoDB 3.4, you cannot create a custom role that uses actions introduced in MongoDB 3.6, such as useUUID.

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var testRole = new Mongodbatlas.CustomDbRole(&quot;testRole&quot;, new Mongodbatlas.CustomDbRoleArgs
    {
        Actions = 
        {
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;UPDATE&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;INSERT&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;REMOVE&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
        },
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        RoleName = &quot;myCustomRole&quot;,
    });
}

}

Example Usage with inherited roles

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var inheritedRoleOne = new Mongodbatlas.CustomDbRole(&quot;inheritedRoleOne&quot;, new Mongodbatlas.CustomDbRoleArgs
    {
        Actions = 
        {
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;INSERT&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
        },
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        RoleName = &quot;insertRole&quot;,
    });
    var inheritedRoleTwo = new Mongodbatlas.CustomDbRole(&quot;inheritedRoleTwo&quot;, new Mongodbatlas.CustomDbRoleArgs
    {
        Actions = 
        {
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;SERVER_STATUS&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        Cluster = true,
                    },
                },
            },
        },
        ProjectId = inheritedRoleOne.ProjectId,
        RoleName = &quot;statusServerRole&quot;,
    });
    var testRole = new Mongodbatlas.CustomDbRole(&quot;testRole&quot;, new Mongodbatlas.CustomDbRoleArgs
    {
        Actions = 
        {
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;UPDATE&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
            new Mongodbatlas.Inputs.CustomDbRoleActionArgs
            {
                Action = &quot;REMOVE&quot;,
                Resources = 
                {
                    new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
                    {
                        CollectionName = &quot;&quot;,
                        DatabaseName = &quot;anyDatabase&quot;,
                    },
                },
            },
        },
        InheritedRoles = 
        {
            new Mongodbatlas.Inputs.CustomDbRoleInheritedRoleArgs
            {
                DatabaseName = &quot;admin&quot;,
                RoleName = inheritedRoleOne.RoleName,
            },
            new Mongodbatlas.Inputs.CustomDbRoleInheritedRoleArgs
            {
                DatabaseName = &quot;admin&quot;,
                RoleName = inheritedRoleTwo.RoleName,
            },
        },
        ProjectId = inheritedRoleOne.ProjectId,
        RoleName = &quot;myCustomRole&quot;,
    });
}

}

CustomDbRoleArgs

CustomDbRoleState

DatabaseUser

DatabaseUserArgs

DatabaseUserState

EncryptionAtRest

mongodbatlas..EncryptionAtRest Atlas encrypts your data at rest using encrypted storage media. Using keys you manage with AWS KMS, Atlas encrypts your data a second time when it writes it to the MongoDB encrypted storage engine. You can use the following clouds: AWS CMK, AZURE KEY VAULT and GOOGLE KEY VAULT to encrypt the MongoDB master encryption keys.

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.EncryptionAtRest(&quot;test&quot;, new Mongodbatlas.EncryptionAtRestArgs
    {
        AwsKms = new Mongodbatlas.Inputs.EncryptionAtRestAwsKmsArgs
        {
            Access_key_id = &quot;AKIAIOSFODNN7EXAMPLE&quot;,
            Customer_master_key_id = &quot;030gce02-586d-48d2-a966-05ea954fde0g&quot;,
            Enabled = true,
            Region = &quot;US_EAST_1&quot;,
            Secret_access_key = &quot;wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&quot;,
        },
        AzureKeyVault = new Mongodbatlas.Inputs.EncryptionAtRestAzureKeyVaultArgs
        {
            Azure_environment = &quot;AZURE&quot;,
            Client_id = &quot;g54f9e2-89e3-40fd-8188-EXAMPLEID&quot;,
            Enabled = true,
            Key_identifier = &quot;https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86&quot;,
            Key_vault_name = &quot;EXAMPLEKeyVault&quot;,
            Resource_group_name = &quot;ExampleRGName&quot;,
            Secret = &quot;EXAMPLESECRET&quot;,
            Subscription_id = &quot;0ec944e3-g725-44f9-a147-EXAMPLEID&quot;,
            Tenant_id = &quot;e8e4b6ba-ff32-4c88-a9af-EXAMPLEID&quot;,
        },
        GoogleCloudKms = new Mongodbatlas.Inputs.EncryptionAtRestGoogleCloudKmsArgs
        {
            Enabled = true,
            Key_version_resource_id = &quot;projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1&quot;,
            Service_account_key = &quot;{\&quot;type\&quot;: \&quot;service_account\&quot;,\&quot;project_id\&quot;: \&quot;my-project-common-0\&quot;,\&quot;private_key_id\&quot;: \&quot;e120598ea4f88249469fcdd75a9a785c1bb3\&quot;,\&quot;private_key\&quot;: \&quot;-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\&quot;,\&quot;client_email\&quot;: \&quot;my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\&quot;,\&quot;client_id\&quot;: \&quot;10180967717292066\&quot;,\&quot;auth_uri\&quot;: \&quot;https://accounts.google.com/o/oauth2/auth\&quot;,\&quot;token_uri\&quot;: \&quot;https://accounts.google.com/o/oauth2/token\&quot;,\&quot;auth_provider_x509_cert_url\&quot;: \&quot;https://www.googleapis.com/oauth2/v1/certs\&quot;,\&quot;client_x509_cert_url\&quot;: \&quot;https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com\&quot;}&quot;,
        },
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
    });
}

}

EncryptionAtRestArgs

EncryptionAtRestState

Get509AuthenticationDatabaseUser

Get509AuthenticationDatabaseUserArgs

Get509AuthenticationDatabaseUserResult

GetAlertConfiguration

GetAlertConfigurationArgs

GetAlertConfigurationResult

GetAuditing

GetAuditingArgs

GetAuditingResult

GetCloudProviderSnapshot

GetCloudProviderSnapshotArgs

GetCloudProviderSnapshotBackupPolicy

GetCloudProviderSnapshotBackupPolicyArgs

GetCloudProviderSnapshotBackupPolicyResult

GetCloudProviderSnapshotRestoreJob

GetCloudProviderSnapshotRestoreJobArgs

GetCloudProviderSnapshotRestoreJobResult

GetCloudProviderSnapshotRestoreJobs

GetCloudProviderSnapshotRestoreJobsArgs

GetCloudProviderSnapshotRestoreJobsResult

GetCloudProviderSnapshotResult

GetCloudProviderSnapshots

GetCloudProviderSnapshotsArgs

GetCloudProviderSnapshotsResult

GetCluster

GetClusterArgs

GetClusterResult

GetClusters

GetClustersArgs

GetClustersResult

GetCustomDbRole

GetCustomDbRoleArgs

GetCustomDbRoleResult

GetCustomDbRoles

GetCustomDbRolesArgs

GetCustomDbRolesResult

GetDatabaseUser

GetDatabaseUserArgs

GetDatabaseUserResult

GetDatabaseUsers

GetDatabaseUsersArgs

GetDatabaseUsersResult

GetGlobalClusterConfig

GetGlobalClusterConfigArgs

GetGlobalClusterConfigResult

GetMaintenanceWindow

GetMaintenanceWindowArgs

GetMaintenanceWindowResult

GetNetworkContainer

GetNetworkContainerArgs

GetNetworkContainerResult

GetNetworkContainers

GetNetworkContainersArgs

GetNetworkContainersResult

GetNetworkPeering

GetNetworkPeeringArgs

GetNetworkPeeringResult

GetNetworkPeerings

GetNetworkPeeringsArgs

GetNetworkPeeringsResult

GetPrivateEndpoint

GetPrivateEndpointArgs

GetPrivateEndpointInterfaceLink

GetPrivateEndpointInterfaceLinkArgs

GetPrivateEndpointInterfaceLinkResult

GetPrivateEndpointResult

GetProject

GetProjectArgs

GetProjectResult

GetProjects

GetProjectsResult

GetTeam

GetTeamArgs

GetTeamResult

GetTeams

GetTeamsArgs

GetTeamsResult

GlobalClusterConfig

mongodbatlas..GlobalClusterConfig provides a Global Cluster Configuration resource.

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

GlobalClusterConfigArgs

GlobalClusterConfigState

MaintenanceWindow

mongodbatlas..MaintenanceWindow provides a resource to schedule a maintenance window for your MongoDB Atlas Project and/or set to defer a scheduled maintenance up to two times.

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

Maintenance Window Considerations:

  • Urgent Maintenance Activities Cannot Wait: Urgent maintenance activities such as security patches cannot wait for your chosen window. Atlas will start those maintenance activities when needed.

Once maintenance is scheduled for your cluster, you cannot change your maintenance window until the current maintenance efforts have completed.

  • Maintenance Requires Replica Set Elections: Atlas performs maintenance the same way as the manual maintenance procedure. This requires at least one replica set election during the maintenance window per replica set.
  • Maintenance Starts As Close to the Hour As Possible: Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or expected system issues could delay the start time.

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.MaintenanceWindow(&quot;test&quot;, new Mongodbatlas.MaintenanceWindowArgs
    {
        DayOfWeek = 3,
        HourOfDay = 4,
        ProjectId = &quot;&lt;your-project-id>&quot;,
    });
}

}

MaintenanceWindowArgs

MaintenanceWindowState

NetworkContainer

mongodbatlas..NetworkContainer provides a Network Peering Container resource. The resource lets you create, edit and delete network peering containers. The resource requires your Project ID.

IMPORTANT: This resource creates one Network Peering container into which Atlas can deploy Network Peering connections. An Atlas project can have a maximum of one container for each cloud provider. You must have either the Project Owner or Organization Owner role to successfully call this endpoint.

The following table outlines the maximum number of Network Peering containers per cloud provider:

  • Cloud Provider: GCP - Container Limit: One container per project.
  • Cloud Provider: AWS and Azure - Container Limit: One container per cloud provider region.

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

Example Usage

Example with AWS.

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.NetworkContainer(&quot;test&quot;, new Mongodbatlas.NetworkContainerArgs
    {
        AtlasCidrBlock = &quot;10.8.0.0/21&quot;,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderName = &quot;AWS&quot;,
        RegionName = &quot;US_EAST_1&quot;,
    });
}

}

Example with GCP

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.NetworkContainer(&quot;test&quot;, new Mongodbatlas.NetworkContainerArgs
    {
        AtlasCidrBlock = &quot;10.8.0.0/21&quot;,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderName = &quot;GCP&quot;,
    });
}

}

Example with Azure

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.NetworkContainer(&quot;test&quot;, new Mongodbatlas.NetworkContainerArgs
    {
        AtlasCidrBlock = &quot;10.8.0.0/21&quot;,
        ProjectId = &quot;&lt;YOUR-PROJECT-ID>&quot;,
        ProviderName = &quot;AZURE&quot;,
        Region = &quot;US_EAST_2&quot;,
    });
}

}

NetworkContainerArgs

NetworkContainerState

NetworkPeering

NetworkPeeringArgs

NetworkPeeringState

PrivateEndpoint

mongodbatlas..PrivateEndpoint provides a Private Endpoint resource. This represents a Private Endpoint Connection that can be created in an Atlas project.

**IMPORTANT:**You must have one of the following roles to successfully handle the resource:

  • Organization Owner
  • Project Owner

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

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.PrivateEndpoint(&quot;test&quot;, new Mongodbatlas.PrivateEndpointArgs
    {
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        ProviderName = &quot;AWS&quot;,
        Region = &quot;us-east-1&quot;,
    });
}

}

PrivateEndpointArgs

PrivateEndpointInterfaceLink

mongodbatlas..PrivateEndpointInterfaceLink provides a Private Endpoint Interface Link resource. This represents a Private Endpoint Interface Link, which adds one interface endpoint to a private endpoint connection in an Atlas project.

**IMPORTANT:**You must have one of the following roles to successfully handle the resource:

  • Organization Owner
  • Project Owner

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var testPrivateEndpoint = new Mongodbatlas.PrivateEndpoint(&quot;testPrivateEndpoint&quot;, new Mongodbatlas.PrivateEndpointArgs
    {
        ProjectId = &quot;&lt;PROJECT_ID>&quot;,
        ProviderName = &quot;AWS&quot;,
        Region = &quot;us-east-1&quot;,
    });
    var ptfeService = new Aws.Ec2.VpcEndpoint(&quot;ptfeService&quot;, new Aws.Ec2.VpcEndpointArgs
    {
        SecurityGroupIds = 
        {
            &quot;sg-3f238186&quot;,
        },
        ServiceName = testPrivateEndpoint.EndpointServiceName,
        SubnetIds = 
        {
            &quot;subnet-de0406d2&quot;,
        },
        VpcEndpointType = &quot;Interface&quot;,
        VpcId = &quot;vpc-7fc0a543&quot;,
    });
    var testPrivateEndpointInterfaceLink = new Mongodbatlas.PrivateEndpointInterfaceLink(&quot;testPrivateEndpointInterfaceLink&quot;, new Mongodbatlas.PrivateEndpointInterfaceLinkArgs
    {
        InterfaceEndpointId = ptfeService.Id,
        PrivateLinkId = testPrivateEndpoint.PrivateLinkId,
        ProjectId = testPrivateEndpoint.ProjectId,
    });
}

}

PrivateEndpointInterfaceLinkArgs

PrivateEndpointInterfaceLinkState

PrivateEndpointState

PrivateIpMode

mongodbatlas..PrivateIpMode provides a Private IP Mode resource. This allows one to disable Connect via Peering Only mode for a MongoDB Atlas Project.

Deprecated Feature: <br> This feature has been deprecated. Use Split Horizon connection strings to connect to your cluster. These connection strings allow you to connect using both VPC/VNet Peering and whitelisted public IP addresses. To learn more about support for Split Horizon, see this FAQ. You need this endpoint to disable Peering Only.

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var myPrivateIpMode = new Mongodbatlas.PrivateIpMode(&quot;myPrivateIpMode&quot;, new Mongodbatlas.PrivateIpModeArgs
    {
        Enabled = false,
        ProjectId = &quot;&lt;YOUR PROJECT ID>&quot;,
    });
}

}

PrivateIpModeArgs

PrivateIpModeState

Project

ProjectArgs

ProjectIpWhitelist

mongodbatlas..ProjectIpWhitelist provides an IP Whitelist entry resource. The whitelist grants access from IPs, CIDRs or AWS Security Groups (if VPC Peering is enabled) to clusters within the Project.

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

IMPORTANT: When you remove an entry from the whitelist, existing connections from the removed address(es) may remain open for a variable amount of time. How much time passes before Atlas closes the connection depends on several factors, including how the connection was established, the particular behavior of the application or driver using the address, and the connection protocol (e.g., TCP or UDP). This is particularly important to consider when changing an existing IP address or CIDR block as they cannot be updated via the Provider (comments can however), hence a change will force the destruction and recreation of entries.

Example Usage

Using CIDR Block

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.ProjectIpWhitelist(&quot;test&quot;, new Mongodbatlas.ProjectIpWhitelistArgs
    {
        CidrBlock = &quot;1.2.3.4/32&quot;,
        Comment = &quot;cidr block for tf acc testing&quot;,
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
    });
}

}

Using IP Address

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.ProjectIpWhitelist(&quot;test&quot;, new Mongodbatlas.ProjectIpWhitelistArgs
    {
        Comment = &quot;ip address for tf acc testing&quot;,
        IpAddress = &quot;2.3.4.5&quot;,
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
    });
}

}

Using an AWS Security Group

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var testNetworkContainer = new Mongodbatlas.NetworkContainer(&quot;testNetworkContainer&quot;, new Mongodbatlas.NetworkContainerArgs
    {
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        AtlasCidrBlock = &quot;192.168.208.0/21&quot;,
        ProviderName = &quot;AWS&quot;,
        RegionName = &quot;US_EAST_1&quot;,
    });
    var testNetworkPeering = new Mongodbatlas.NetworkPeering(&quot;testNetworkPeering&quot;, new Mongodbatlas.NetworkPeeringArgs
    {
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        ContainerId = testNetworkContainer.ContainerId,
        AccepterRegionName = &quot;us-east-1&quot;,
        ProviderName = &quot;AWS&quot;,
        RouteTableCidrBlock = &quot;172.31.0.0/16&quot;,
        VpcId = &quot;vpc-0d93d6f69f1578bd8&quot;,
        AwsAccountId = &quot;232589400519&quot;,
    });
    var testProjectIpWhitelist = new Mongodbatlas.ProjectIpWhitelist(&quot;testProjectIpWhitelist&quot;, new Mongodbatlas.ProjectIpWhitelistArgs
    {
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        AwsSecurityGroup = &quot;sg-0026348ec11780bd1&quot;,
        Comment = &quot;TestAcc for awsSecurityGroup&quot;,
    });
}

}

ProjectIpWhitelistArgs

ProjectIpWhitelistState

ProjectState

Provider

The provider type for the mongodbatlas package. By default, resources use package-wide configuration settings, however an explicit Provider instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the documentation for more information.

ProviderArgs

Team

mongodbatlas..Teams provides a Team resource. The resource lets you create, edit and delete Teams. Also, Teams can be assigned to multiple projects, and team members’ access to the project is determined by the team’s project role.

IMPORTANT: MongoDB Atlas Team limits: max 250 teams in an organization and max 100 teams per project.

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

MongoDB Atlas Team limits: max 250 teams in an organization and max 100 teams per project.

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
public MyStack()
{
    var test = new Mongodbatlas.Teams(&quot;test&quot;, new Mongodbatlas.TeamsArgs
    {
        OrgId = &quot;&lt;ORGANIZATION-ID>&quot;,
        Usernames = 
        {
            &quot;user1&quot;,
            &quot;user2&quot;,
            &quot;user3&quot;,
        },
    });
}

}

TeamArgs

Teams

TeamsArgs

TeamsState

TeamState

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(&quot;user&quot;, new Mongodbatlas.DatabaseUserArgs
    {
        DatabaseName = &quot;$$external&quot;,
        Labels = 
        {
            new Mongodbatlas.Inputs.DatabaseUserLabelArgs
            {
                Key = &quot;My Key&quot;,
                Value = &quot;My Value&quot;,
            },
        },
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
        Roles = 
        {
            new Mongodbatlas.Inputs.DatabaseUserRoleArgs
            {
                DatabaseName = &quot;admin&quot;,
                RoleName = &quot;atlasAdmin&quot;,
            },
        },
        Username = &quot;myUsername&quot;,
        X509Type = &quot;MANAGED&quot;,
    });
    var test = new Mongodbatlas.X509AuthenticationDatabaseUser(&quot;test&quot;, 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(&quot;test&quot;, new Mongodbatlas.X509AuthenticationDatabaseUserArgs
    {
        CustomerX509Cas = @&quot;  -----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-----&quot;&quot;

&quot;,
        ProjectId = &quot;&lt;PROJECT-ID>&quot;,
    });
}

}

X509AuthenticationDatabaseUserArgs

X509AuthenticationDatabaseUserState

Back to top Copyright 2016-2020, Pulumi Corporation.