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
groupIdin 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
groupIdin 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
groupIdin 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
groupIdin 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> • Free tier cluster creation (M0) is not supported via API or by this Provider. <br> • Shared tier clusters (M2, M5) cannot be upgraded to higher tiers via API or by this Provider. <br> • Changes to cluster configurations can affect costs. Before making changes, please see Billing. <br> • 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("cluster-test", new Mongodbatlas.ClusterArgs
{
AutoScalingDiskGbEnabled = true,
DiskSizeGb = 100,
MongoDbMajorVersion = "4.0",
NumShards = 1,
ProjectId = "<YOUR-PROJECT-ID>",
ProviderBackupEnabled = true,
ProviderDiskIops = 300,
ProviderEncryptEbsVolume = true,
ProviderInstanceSizeName = "M40",
ProviderName = "AWS",
ProviderRegionName = "US_EAST_1",
ProviderVolumeType = "STANDARD",
ReplicationFactor = 3,
});
}
}
Example Azure cluster.
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.Cluster("test", new Mongodbatlas.ClusterArgs
{
AutoScalingDiskGbEnabled = true,
MongoDbMajorVersion = "4.0",
NumShards = 1,
ProjectId = "<YOUR-PROJECT-ID>",
ProviderBackupEnabled = true,
ProviderDiskTypeName = "P6",
ProviderInstanceSizeName = "M30",
ProviderName = "AZURE",
ProviderRegionName = "US_EAST_2",
ReplicationFactor = 3,
});
}
}
Example GCP cluster
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.Cluster("test", new Mongodbatlas.ClusterArgs
{
AutoScalingDiskGbEnabled = true,
DiskSizeGb = 40,
MongoDbMajorVersion = "4.0",
NumShards = 1,
ProjectId = "<YOUR-PROJECT-ID>",
ProviderBackupEnabled = true,
ProviderInstanceSizeName = "M30",
ProviderName = "GCP",
ProviderRegionName = "US_EAST_4",
ReplicationFactor = 3,
});
}
}
Example Multi Region cluster
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var cluster_test = new Mongodbatlas.Cluster("cluster-test", new Mongodbatlas.ClusterArgs
{
ClusterType = "REPLICASET",
DiskSizeGb = 100,
NumShards = 1,
ProjectId = "<YOUR-PROJECT-ID>",
ProviderBackupEnabled = true,
ProviderDiskIops = 300,
ProviderInstanceSizeName = "M10",
ProviderName = "AWS",
ProviderVolumeType = "STANDARD",
ReplicationSpecs =
{
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 1,
RegionsConfig =
{
{
{ "electableNodes", 3 },
{ "priority", 7 },
{ "readOnlyNodes", 0 },
{ "regionName", "US_EAST_1" },
},
{
{ "electableNodes", 2 },
{ "priority", 6 },
{ "readOnlyNodes", 0 },
{ "regionName", "US_EAST_2" },
},
{
{ "electableNodes", 2 },
{ "priority", 5 },
{ "readOnlyNodes", 2 },
{ "regionName", "US_WEST_1" },
},
},
},
},
});
}
}
Example Global cluster
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var cluster_test = new Mongodbatlas.Cluster("cluster-test", new Mongodbatlas.ClusterArgs
{
ClusterType = "GEOSHARDED",
DiskSizeGb = 80,
NumShards = 1,
ProjectId = "<YOUR-PROJECT-ID>",
ProviderBackupEnabled = true,
ProviderDiskIops = 240,
ProviderInstanceSizeName = "M30",
ProviderName = "AWS",
ProviderVolumeType = "STANDARD",
ReplicationSpecs =
{
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 2,
RegionsConfig =
{
{
{ "electableNodes", 3 },
{ "priority", 7 },
{ "readOnlyNodes", 0 },
{ "regionName", "US_EAST_1" },
},
},
ZoneName = "Zone 1",
},
new Mongodbatlas.Inputs.ClusterReplicationSpecArgs
{
NumShards = 2,
RegionsConfig =
{
{
{ "electableNodes", 3 },
{ "priority", 7 },
{ "readOnlyNodes", 0 },
{ "regionName", "EU_CENTRAL_1" },
},
},
ZoneName = "Zone 2",
},
},
});
}
}
Example AWS Shared Tier cluster
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var cluster_test = new Mongodbatlas.Cluster("cluster-test", new Mongodbatlas.ClusterArgs
{
AutoScalingDiskGbEnabled = "false",
BackingProviderName = "AWS",
DiskSizeGb = "2",
MongoDbMajorVersion = "4.2",
ProjectId = "<YOUR-PROJECT-ID>",
ProviderInstanceSizeName = "M2",
ProviderName = "TENANT",
ProviderRegionName = "US_EAST_1",
});
}
}
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("testRole", new Mongodbatlas.CustomDbRoleArgs
{
Actions =
{
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "UPDATE",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "INSERT",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "REMOVE",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
},
ProjectId = "<PROJECT-ID>",
RoleName = "myCustomRole",
});
}
}
Example Usage with inherited roles
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var inheritedRoleOne = new Mongodbatlas.CustomDbRole("inheritedRoleOne", new Mongodbatlas.CustomDbRoleArgs
{
Actions =
{
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "INSERT",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
},
ProjectId = "<PROJECT-ID>",
RoleName = "insertRole",
});
var inheritedRoleTwo = new Mongodbatlas.CustomDbRole("inheritedRoleTwo", new Mongodbatlas.CustomDbRoleArgs
{
Actions =
{
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "SERVER_STATUS",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
Cluster = true,
},
},
},
},
ProjectId = inheritedRoleOne.ProjectId,
RoleName = "statusServerRole",
});
var testRole = new Mongodbatlas.CustomDbRole("testRole", new Mongodbatlas.CustomDbRoleArgs
{
Actions =
{
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "UPDATE",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
new Mongodbatlas.Inputs.CustomDbRoleActionArgs
{
Action = "REMOVE",
Resources =
{
new Mongodbatlas.Inputs.CustomDbRoleActionResourceArgs
{
CollectionName = "",
DatabaseName = "anyDatabase",
},
},
},
},
InheritedRoles =
{
new Mongodbatlas.Inputs.CustomDbRoleInheritedRoleArgs
{
DatabaseName = "admin",
RoleName = inheritedRoleOne.RoleName,
},
new Mongodbatlas.Inputs.CustomDbRoleInheritedRoleArgs
{
DatabaseName = "admin",
RoleName = inheritedRoleTwo.RoleName,
},
},
ProjectId = inheritedRoleOne.ProjectId,
RoleName = "myCustomRole",
});
}
}
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
groupIdin the official documentation.
Example Usage
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.EncryptionAtRest("test", new Mongodbatlas.EncryptionAtRestArgs
{
AwsKms = new Mongodbatlas.Inputs.EncryptionAtRestAwsKmsArgs
{
Access_key_id = "AKIAIOSFODNN7EXAMPLE",
Customer_master_key_id = "030gce02-586d-48d2-a966-05ea954fde0g",
Enabled = true,
Region = "US_EAST_1",
Secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
},
AzureKeyVault = new Mongodbatlas.Inputs.EncryptionAtRestAzureKeyVaultArgs
{
Azure_environment = "AZURE",
Client_id = "g54f9e2-89e3-40fd-8188-EXAMPLEID",
Enabled = true,
Key_identifier = "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
Key_vault_name = "EXAMPLEKeyVault",
Resource_group_name = "ExampleRGName",
Secret = "EXAMPLESECRET",
Subscription_id = "0ec944e3-g725-44f9-a147-EXAMPLEID",
Tenant_id = "e8e4b6ba-ff32-4c88-a9af-EXAMPLEID",
},
GoogleCloudKms = new Mongodbatlas.Inputs.EncryptionAtRestGoogleCloudKmsArgs
{
Enabled = true,
Key_version_resource_id = "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
Service_account_key = "{\"type\": \"service_account\",\"project_id\": \"my-project-common-0\",\"private_key_id\": \"e120598ea4f88249469fcdd75a9a785c1bb3\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\",\"client_email\": \"my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\",\"client_id\": \"10180967717292066\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com\"}",
},
ProjectId = "<PROJECT-ID>",
});
}
}
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
groupIdin 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("test", new Mongodbatlas.MaintenanceWindowArgs
{
DayOfWeek = 3,
HourOfDay = 4,
ProjectId = "<your-project-id>",
});
}
}
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("test", new Mongodbatlas.NetworkContainerArgs
{
AtlasCidrBlock = "10.8.0.0/21",
ProjectId = "<YOUR-PROJECT-ID>",
ProviderName = "AWS",
RegionName = "US_EAST_1",
});
}
}
Example with GCP
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.NetworkContainer("test", new Mongodbatlas.NetworkContainerArgs
{
AtlasCidrBlock = "10.8.0.0/21",
ProjectId = "<YOUR-PROJECT-ID>",
ProviderName = "GCP",
});
}
}
Example with Azure
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.NetworkContainer("test", new Mongodbatlas.NetworkContainerArgs
{
AtlasCidrBlock = "10.8.0.0/21",
ProjectId = "<YOUR-PROJECT-ID>",
ProviderName = "AZURE",
Region = "US_EAST_2",
});
}
}
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("test", new Mongodbatlas.PrivateEndpointArgs
{
ProjectId = "<PROJECT-ID>",
ProviderName = "AWS",
Region = "us-east-1",
});
}
}
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("testPrivateEndpoint", new Mongodbatlas.PrivateEndpointArgs
{
ProjectId = "<PROJECT_ID>",
ProviderName = "AWS",
Region = "us-east-1",
});
var ptfeService = new Aws.Ec2.VpcEndpoint("ptfeService", new Aws.Ec2.VpcEndpointArgs
{
SecurityGroupIds =
{
"sg-3f238186",
},
ServiceName = testPrivateEndpoint.EndpointServiceName,
SubnetIds =
{
"subnet-de0406d2",
},
VpcEndpointType = "Interface",
VpcId = "vpc-7fc0a543",
});
var testPrivateEndpointInterfaceLink = new Mongodbatlas.PrivateEndpointInterfaceLink("testPrivateEndpointInterfaceLink", 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("myPrivateIpMode", new Mongodbatlas.PrivateIpModeArgs
{
Enabled = false,
ProjectId = "<YOUR PROJECT ID>",
});
}
}
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
groupIdin 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("test", new Mongodbatlas.ProjectIpWhitelistArgs
{
CidrBlock = "1.2.3.4/32",
Comment = "cidr block for tf acc testing",
ProjectId = "<PROJECT-ID>",
});
}
}
Using IP Address
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var test = new Mongodbatlas.ProjectIpWhitelist("test", new Mongodbatlas.ProjectIpWhitelistArgs
{
Comment = "ip address for tf acc testing",
IpAddress = "2.3.4.5",
ProjectId = "<PROJECT-ID>",
});
}
}
Using an AWS Security Group
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
class MyStack : Stack
{
public MyStack()
{
var testNetworkContainer = new Mongodbatlas.NetworkContainer("testNetworkContainer", new Mongodbatlas.NetworkContainerArgs
{
ProjectId = "<PROJECT-ID>",
AtlasCidrBlock = "192.168.208.0/21",
ProviderName = "AWS",
RegionName = "US_EAST_1",
});
var testNetworkPeering = new Mongodbatlas.NetworkPeering("testNetworkPeering", new Mongodbatlas.NetworkPeeringArgs
{
ProjectId = "<PROJECT-ID>",
ContainerId = testNetworkContainer.ContainerId,
AccepterRegionName = "us-east-1",
ProviderName = "AWS",
RouteTableCidrBlock = "172.31.0.0/16",
VpcId = "vpc-0d93d6f69f1578bd8",
AwsAccountId = "232589400519",
});
var testProjectIpWhitelist = new Mongodbatlas.ProjectIpWhitelist("testProjectIpWhitelist", new Mongodbatlas.ProjectIpWhitelistArgs
{
ProjectId = "<PROJECT-ID>",
AwsSecurityGroup = "sg-0026348ec11780bd1",
Comment = "TestAcc for awsSecurityGroup",
});
}
}
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("test", new Mongodbatlas.TeamsArgs
{
OrgId = "<ORGANIZATION-ID>",
Usernames =
{
"user1",
"user2",
"user3",
},
});
}
}
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("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>",
});
}
}