mongodbatlas.OnlineArchive
Explore with Pulumi AI
mongodbatlas.OnlineArchive
resource provides access to create, edit, pause and resume an online archive for a collection.
NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.
IMPORTANT: The collection must exists before performing an online archive.
IMPORTANT: There are fields that are immutable after creation, i.e if
date_field
value does not exist in the collection, the online archive state will be pending forever, and this field cannot be updated, that means a destroy is required, known errorONLINE_ARCHIVE_CANNOT_MODIFY_FIELD
Example Usage
S
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.OnlineArchive("test", {
projectId: projectId,
clusterName: clusterName,
collName: collectionName,
dbName: databaseName,
partitionFields: [
{
fieldName: "dateField",
order: 0,
},
{
fieldName: "firstName",
order: 1,
},
{
fieldName: "lastName",
order: 2,
},
],
criteria: {
type: "DATE",
dateField: "dateField",
expireAfterDays: 5,
},
schedule: {
type: "DAILY",
endHour: 1,
endMinute: 1,
startHour: 1,
startMinute: 1,
},
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.OnlineArchive("test",
project_id=project_id,
cluster_name=cluster_name,
coll_name=collection_name,
db_name=database_name,
partition_fields=[
mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="dateField",
order=0,
),
mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="firstName",
order=1,
),
mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="lastName",
order=2,
),
],
criteria=mongodbatlas.OnlineArchiveCriteriaArgs(
type="DATE",
date_field="dateField",
expire_after_days=5,
),
schedule=mongodbatlas.OnlineArchiveScheduleArgs(
type="DAILY",
end_hour=1,
end_minute=1,
start_hour=1,
start_minute=1,
))
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mongodbatlas.NewOnlineArchive(ctx, "test", &mongodbatlas.OnlineArchiveArgs{
ProjectId: pulumi.Any(projectId),
ClusterName: pulumi.Any(clusterName),
CollName: pulumi.Any(collectionName),
DbName: pulumi.Any(databaseName),
PartitionFields: mongodbatlas.OnlineArchivePartitionFieldArray{
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("dateField"),
Order: pulumi.Int(0),
},
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("firstName"),
Order: pulumi.Int(1),
},
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("lastName"),
Order: pulumi.Int(2),
},
},
Criteria: &mongodbatlas.OnlineArchiveCriteriaArgs{
Type: pulumi.String("DATE"),
DateField: pulumi.String("dateField"),
ExpireAfterDays: pulumi.Int(5),
},
Schedule: &mongodbatlas.OnlineArchiveScheduleArgs{
Type: pulumi.String("DAILY"),
EndHour: pulumi.Int(1),
EndMinute: pulumi.Int(1),
StartHour: pulumi.Int(1),
StartMinute: pulumi.Int(1),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.OnlineArchive("test", new()
{
ProjectId = projectId,
ClusterName = clusterName,
CollName = collectionName,
DbName = databaseName,
PartitionFields = new[]
{
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "dateField",
Order = 0,
},
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "firstName",
Order = 1,
},
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "lastName",
Order = 2,
},
},
Criteria = new Mongodbatlas.Inputs.OnlineArchiveCriteriaArgs
{
Type = "DATE",
DateField = "dateField",
ExpireAfterDays = 5,
},
Schedule = new Mongodbatlas.Inputs.OnlineArchiveScheduleArgs
{
Type = "DAILY",
EndHour = 1,
EndMinute = 1,
StartHour = 1,
StartMinute = 1,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.OnlineArchive;
import com.pulumi.mongodbatlas.OnlineArchiveArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchivePartitionFieldArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchiveCriteriaArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchiveScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new OnlineArchive("test", OnlineArchiveArgs.builder()
.projectId(projectId)
.clusterName(clusterName)
.collName(collectionName)
.dbName(databaseName)
.partitionFields(
OnlineArchivePartitionFieldArgs.builder()
.fieldName("dateField")
.order(0)
.build(),
OnlineArchivePartitionFieldArgs.builder()
.fieldName("firstName")
.order(1)
.build(),
OnlineArchivePartitionFieldArgs.builder()
.fieldName("lastName")
.order(2)
.build())
.criteria(OnlineArchiveCriteriaArgs.builder()
.type("DATE")
.dateField("dateField")
.expireAfterDays(5)
.build())
.schedule(OnlineArchiveScheduleArgs.builder()
.type("DAILY")
.endHour(1)
.endMinute(1)
.startHour(1)
.startMinute(1)
.build())
.build());
}
}
resources:
test:
type: mongodbatlas:OnlineArchive
properties:
projectId: ${projectId}
clusterName: ${clusterName}
collName: ${collectionName}
dbName: ${databaseName}
partitionFields:
- fieldName: dateField
order: 0
- fieldName: firstName
order: 1
- fieldName: lastName
order: 2
criteria:
type: DATE
dateField: dateField
expireAfterDays: 5
schedule:
type: DAILY
endHour: 1
endMinute: 1
startHour: 1
startMinute: 1
For custom criteria example
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.OnlineArchive("test", {
projectId: projectId,
clusterName: clusterName,
collName: collectionName,
dbName: databaseName,
partitionFields: [
{
fieldName: "firstName",
order: 0,
},
{
fieldName: "secondName",
order: 1,
},
],
criteria: {
type: "CUSTOM",
query: "{ \"department\": \"engineering\" }",
},
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.OnlineArchive("test",
project_id=project_id,
cluster_name=cluster_name,
coll_name=collection_name,
db_name=database_name,
partition_fields=[
mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="firstName",
order=0,
),
mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="secondName",
order=1,
),
],
criteria=mongodbatlas.OnlineArchiveCriteriaArgs(
type="CUSTOM",
query="{ \"department\": \"engineering\" }",
))
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mongodbatlas.NewOnlineArchive(ctx, "test", &mongodbatlas.OnlineArchiveArgs{
ProjectId: pulumi.Any(projectId),
ClusterName: pulumi.Any(clusterName),
CollName: pulumi.Any(collectionName),
DbName: pulumi.Any(databaseName),
PartitionFields: mongodbatlas.OnlineArchivePartitionFieldArray{
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("firstName"),
Order: pulumi.Int(0),
},
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("secondName"),
Order: pulumi.Int(1),
},
},
Criteria: &mongodbatlas.OnlineArchiveCriteriaArgs{
Type: pulumi.String("CUSTOM"),
Query: pulumi.String("{ \"department\": \"engineering\" }"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.OnlineArchive("test", new()
{
ProjectId = projectId,
ClusterName = clusterName,
CollName = collectionName,
DbName = databaseName,
PartitionFields = new[]
{
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "firstName",
Order = 0,
},
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "secondName",
Order = 1,
},
},
Criteria = new Mongodbatlas.Inputs.OnlineArchiveCriteriaArgs
{
Type = "CUSTOM",
Query = "{ \"department\": \"engineering\" }",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.OnlineArchive;
import com.pulumi.mongodbatlas.OnlineArchiveArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchivePartitionFieldArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchiveCriteriaArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new OnlineArchive("test", OnlineArchiveArgs.builder()
.projectId(projectId)
.clusterName(clusterName)
.collName(collectionName)
.dbName(databaseName)
.partitionFields(
OnlineArchivePartitionFieldArgs.builder()
.fieldName("firstName")
.order(0)
.build(),
OnlineArchivePartitionFieldArgs.builder()
.fieldName("secondName")
.order(1)
.build())
.criteria(OnlineArchiveCriteriaArgs.builder()
.type("CUSTOM")
.query("{ \"department\": \"engineering\" }")
.build())
.build());
}
}
resources:
test:
type: mongodbatlas:OnlineArchive
properties:
projectId: ${projectId}
clusterName: ${clusterName}
collName: ${collectionName}
dbName: ${databaseName}
partitionFields:
- fieldName: firstName
order: 0
- fieldName: secondName
order: 1
criteria:
type: CUSTOM
query: '{ "department": "engineering" }'
Defining custom provider and region example
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.OnlineArchive("test", {
projectId: projectId,
clusterName: clusterName,
collName: collectionName,
dbName: databaseName,
dataProcessRegion: {
cloudProvider: "AZURE",
region: "US_EAST_2",
},
partitionFields: [{
fieldName: "firstName",
order: 0,
}],
criteria: {
type: "CUSTOM",
query: "{ \"department\": \"engineering\" }",
},
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.OnlineArchive("test",
project_id=project_id,
cluster_name=cluster_name,
coll_name=collection_name,
db_name=database_name,
data_process_region=mongodbatlas.OnlineArchiveDataProcessRegionArgs(
cloud_provider="AZURE",
region="US_EAST_2",
),
partition_fields=[mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="firstName",
order=0,
)],
criteria=mongodbatlas.OnlineArchiveCriteriaArgs(
type="CUSTOM",
query="{ \"department\": \"engineering\" }",
))
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mongodbatlas.NewOnlineArchive(ctx, "test", &mongodbatlas.OnlineArchiveArgs{
ProjectId: pulumi.Any(projectId),
ClusterName: pulumi.Any(clusterName),
CollName: pulumi.Any(collectionName),
DbName: pulumi.Any(databaseName),
DataProcessRegion: &mongodbatlas.OnlineArchiveDataProcessRegionArgs{
CloudProvider: pulumi.String("AZURE"),
Region: pulumi.String("US_EAST_2"),
},
PartitionFields: mongodbatlas.OnlineArchivePartitionFieldArray{
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("firstName"),
Order: pulumi.Int(0),
},
},
Criteria: &mongodbatlas.OnlineArchiveCriteriaArgs{
Type: pulumi.String("CUSTOM"),
Query: pulumi.String("{ \"department\": \"engineering\" }"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.OnlineArchive("test", new()
{
ProjectId = projectId,
ClusterName = clusterName,
CollName = collectionName,
DbName = databaseName,
DataProcessRegion = new Mongodbatlas.Inputs.OnlineArchiveDataProcessRegionArgs
{
CloudProvider = "AZURE",
Region = "US_EAST_2",
},
PartitionFields = new[]
{
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "firstName",
Order = 0,
},
},
Criteria = new Mongodbatlas.Inputs.OnlineArchiveCriteriaArgs
{
Type = "CUSTOM",
Query = "{ \"department\": \"engineering\" }",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.OnlineArchive;
import com.pulumi.mongodbatlas.OnlineArchiveArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchiveDataProcessRegionArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchivePartitionFieldArgs;
import com.pulumi.mongodbatlas.inputs.OnlineArchiveCriteriaArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new OnlineArchive("test", OnlineArchiveArgs.builder()
.projectId(projectId)
.clusterName(clusterName)
.collName(collectionName)
.dbName(databaseName)
.dataProcessRegion(OnlineArchiveDataProcessRegionArgs.builder()
.cloudProvider("AZURE")
.region("US_EAST_2")
.build())
.partitionFields(OnlineArchivePartitionFieldArgs.builder()
.fieldName("firstName")
.order(0)
.build())
.criteria(OnlineArchiveCriteriaArgs.builder()
.type("CUSTOM")
.query("{ \"department\": \"engineering\" }")
.build())
.build());
}
}
resources:
test:
type: mongodbatlas:OnlineArchive
properties:
projectId: ${projectId}
clusterName: ${clusterName}
collName: ${collectionName}
dbName: ${databaseName}
dataProcessRegion:
cloudProvider: AZURE
region: US_EAST_2
partitionFields:
- fieldName: firstName
order: 0
criteria:
type: CUSTOM
query: '{ "department": "engineering" }'
Create OnlineArchive Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OnlineArchive(name: string, args: OnlineArchiveArgs, opts?: CustomResourceOptions);
@overload
def OnlineArchive(resource_name: str,
args: OnlineArchiveArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OnlineArchive(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_name: Optional[str] = None,
coll_name: Optional[str] = None,
criteria: Optional[OnlineArchiveCriteriaArgs] = None,
db_name: Optional[str] = None,
project_id: Optional[str] = None,
collection_type: Optional[str] = None,
data_expiration_rule: Optional[OnlineArchiveDataExpirationRuleArgs] = None,
data_process_region: Optional[OnlineArchiveDataProcessRegionArgs] = None,
partition_fields: Optional[Sequence[OnlineArchivePartitionFieldArgs]] = None,
paused: Optional[bool] = None,
schedule: Optional[OnlineArchiveScheduleArgs] = None,
sync_creation: Optional[bool] = None)
func NewOnlineArchive(ctx *Context, name string, args OnlineArchiveArgs, opts ...ResourceOption) (*OnlineArchive, error)
public OnlineArchive(string name, OnlineArchiveArgs args, CustomResourceOptions? opts = null)
public OnlineArchive(String name, OnlineArchiveArgs args)
public OnlineArchive(String name, OnlineArchiveArgs args, CustomResourceOptions options)
type: mongodbatlas:OnlineArchive
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args OnlineArchiveArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args OnlineArchiveArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args OnlineArchiveArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OnlineArchiveArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OnlineArchiveArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var onlineArchiveResource = new Mongodbatlas.OnlineArchive("onlineArchiveResource", new()
{
ClusterName = "string",
CollName = "string",
Criteria = new Mongodbatlas.Inputs.OnlineArchiveCriteriaArgs
{
Type = "string",
DateField = "string",
DateFormat = "string",
ExpireAfterDays = 0,
Query = "string",
},
DbName = "string",
ProjectId = "string",
CollectionType = "string",
DataExpirationRule = new Mongodbatlas.Inputs.OnlineArchiveDataExpirationRuleArgs
{
ExpireAfterDays = 0,
},
DataProcessRegion = new Mongodbatlas.Inputs.OnlineArchiveDataProcessRegionArgs
{
CloudProvider = "string",
Region = "string",
},
PartitionFields = new[]
{
new Mongodbatlas.Inputs.OnlineArchivePartitionFieldArgs
{
FieldName = "string",
Order = 0,
FieldType = "string",
},
},
Paused = false,
Schedule = new Mongodbatlas.Inputs.OnlineArchiveScheduleArgs
{
Type = "string",
DayOfMonth = 0,
DayOfWeek = 0,
EndHour = 0,
EndMinute = 0,
StartHour = 0,
StartMinute = 0,
},
SyncCreation = false,
});
example, err := mongodbatlas.NewOnlineArchive(ctx, "onlineArchiveResource", &mongodbatlas.OnlineArchiveArgs{
ClusterName: pulumi.String("string"),
CollName: pulumi.String("string"),
Criteria: &mongodbatlas.OnlineArchiveCriteriaArgs{
Type: pulumi.String("string"),
DateField: pulumi.String("string"),
DateFormat: pulumi.String("string"),
ExpireAfterDays: pulumi.Int(0),
Query: pulumi.String("string"),
},
DbName: pulumi.String("string"),
ProjectId: pulumi.String("string"),
CollectionType: pulumi.String("string"),
DataExpirationRule: &mongodbatlas.OnlineArchiveDataExpirationRuleArgs{
ExpireAfterDays: pulumi.Int(0),
},
DataProcessRegion: &mongodbatlas.OnlineArchiveDataProcessRegionArgs{
CloudProvider: pulumi.String("string"),
Region: pulumi.String("string"),
},
PartitionFields: mongodbatlas.OnlineArchivePartitionFieldArray{
&mongodbatlas.OnlineArchivePartitionFieldArgs{
FieldName: pulumi.String("string"),
Order: pulumi.Int(0),
FieldType: pulumi.String("string"),
},
},
Paused: pulumi.Bool(false),
Schedule: &mongodbatlas.OnlineArchiveScheduleArgs{
Type: pulumi.String("string"),
DayOfMonth: pulumi.Int(0),
DayOfWeek: pulumi.Int(0),
EndHour: pulumi.Int(0),
EndMinute: pulumi.Int(0),
StartHour: pulumi.Int(0),
StartMinute: pulumi.Int(0),
},
SyncCreation: pulumi.Bool(false),
})
var onlineArchiveResource = new OnlineArchive("onlineArchiveResource", OnlineArchiveArgs.builder()
.clusterName("string")
.collName("string")
.criteria(OnlineArchiveCriteriaArgs.builder()
.type("string")
.dateField("string")
.dateFormat("string")
.expireAfterDays(0)
.query("string")
.build())
.dbName("string")
.projectId("string")
.collectionType("string")
.dataExpirationRule(OnlineArchiveDataExpirationRuleArgs.builder()
.expireAfterDays(0)
.build())
.dataProcessRegion(OnlineArchiveDataProcessRegionArgs.builder()
.cloudProvider("string")
.region("string")
.build())
.partitionFields(OnlineArchivePartitionFieldArgs.builder()
.fieldName("string")
.order(0)
.fieldType("string")
.build())
.paused(false)
.schedule(OnlineArchiveScheduleArgs.builder()
.type("string")
.dayOfMonth(0)
.dayOfWeek(0)
.endHour(0)
.endMinute(0)
.startHour(0)
.startMinute(0)
.build())
.syncCreation(false)
.build());
online_archive_resource = mongodbatlas.OnlineArchive("onlineArchiveResource",
cluster_name="string",
coll_name="string",
criteria=mongodbatlas.OnlineArchiveCriteriaArgs(
type="string",
date_field="string",
date_format="string",
expire_after_days=0,
query="string",
),
db_name="string",
project_id="string",
collection_type="string",
data_expiration_rule=mongodbatlas.OnlineArchiveDataExpirationRuleArgs(
expire_after_days=0,
),
data_process_region=mongodbatlas.OnlineArchiveDataProcessRegionArgs(
cloud_provider="string",
region="string",
),
partition_fields=[mongodbatlas.OnlineArchivePartitionFieldArgs(
field_name="string",
order=0,
field_type="string",
)],
paused=False,
schedule=mongodbatlas.OnlineArchiveScheduleArgs(
type="string",
day_of_month=0,
day_of_week=0,
end_hour=0,
end_minute=0,
start_hour=0,
start_minute=0,
),
sync_creation=False)
const onlineArchiveResource = new mongodbatlas.OnlineArchive("onlineArchiveResource", {
clusterName: "string",
collName: "string",
criteria: {
type: "string",
dateField: "string",
dateFormat: "string",
expireAfterDays: 0,
query: "string",
},
dbName: "string",
projectId: "string",
collectionType: "string",
dataExpirationRule: {
expireAfterDays: 0,
},
dataProcessRegion: {
cloudProvider: "string",
region: "string",
},
partitionFields: [{
fieldName: "string",
order: 0,
fieldType: "string",
}],
paused: false,
schedule: {
type: "string",
dayOfMonth: 0,
dayOfWeek: 0,
endHour: 0,
endMinute: 0,
startHour: 0,
startMinute: 0,
},
syncCreation: false,
});
type: mongodbatlas:OnlineArchive
properties:
clusterName: string
collName: string
collectionType: string
criteria:
dateField: string
dateFormat: string
expireAfterDays: 0
query: string
type: string
dataExpirationRule:
expireAfterDays: 0
dataProcessRegion:
cloudProvider: string
region: string
dbName: string
partitionFields:
- fieldName: string
fieldType: string
order: 0
paused: false
projectId: string
schedule:
dayOfMonth: 0
dayOfWeek: 0
endHour: 0
endMinute: 0
startHour: 0
startMinute: 0
type: string
syncCreation: false
OnlineArchive Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The OnlineArchive resource accepts the following input properties:
- Cluster
Name string - Name of the cluster that contains the collection.
- Coll
Name string - Name of the collection.
- Criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- Db
Name string - Name of the database that contains the collection.
- Project
Id string - The unique ID for the project
- Collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- Data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- Data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- Partition
Fields List<OnlineArchive Partition Field> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - Paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- Schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- Sync
Creation bool
- Cluster
Name string - Name of the cluster that contains the collection.
- Coll
Name string - Name of the collection.
- Criteria
Online
Archive Criteria Args - Criteria to use for archiving data. See criteria.
- Db
Name string - Name of the database that contains the collection.
- Project
Id string - The unique ID for the project
- Collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- Data
Expiration OnlineRule Archive Data Expiration Rule Args - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- Data
Process OnlineRegion Archive Data Process Region Args - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- Partition
Fields []OnlineArchive Partition Field Args - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - Paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- Schedule
Online
Archive Schedule Args - Regular frequency and duration when archiving process occurs. See schedule.
- Sync
Creation bool
- cluster
Name String - Name of the cluster that contains the collection.
- coll
Name String - Name of the collection.
- criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- db
Name String - Name of the database that contains the collection.
- project
Id String - The unique ID for the project
- collection
Type String - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- partition
Fields List<OnlineArchive Partition Field> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused Boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- sync
Creation Boolean
- cluster
Name string - Name of the cluster that contains the collection.
- coll
Name string - Name of the collection.
- criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- db
Name string - Name of the database that contains the collection.
- project
Id string - The unique ID for the project
- collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- partition
Fields OnlineArchive Partition Field[] - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- sync
Creation boolean
- cluster_
name str - Name of the cluster that contains the collection.
- coll_
name str - Name of the collection.
- criteria
Online
Archive Criteria Args - Criteria to use for archiving data. See criteria.
- db_
name str - Name of the database that contains the collection.
- project_
id str - The unique ID for the project
- collection_
type str - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- data_
expiration_ Onlinerule Archive Data Expiration Rule Args - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data_
process_ Onlineregion Archive Data Process Region Args - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- partition_
fields Sequence[OnlineArchive Partition Field Args] - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- schedule
Online
Archive Schedule Args - Regular frequency and duration when archiving process occurs. See schedule.
- sync_
creation bool
- cluster
Name String - Name of the cluster that contains the collection.
- coll
Name String - Name of the collection.
- criteria Property Map
- Criteria to use for archiving data. See criteria.
- db
Name String - Name of the database that contains the collection.
- project
Id String - The unique ID for the project
- collection
Type String - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- data
Expiration Property MapRule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process Property MapRegion - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- partition
Fields List<Property Map> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused Boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- schedule Property Map
- Regular frequency and duration when archiving process occurs. See schedule.
- sync
Creation Boolean
Outputs
All input properties are implicitly available as output properties. Additionally, the OnlineArchive resource produces the following output properties:
- archive_
id str - ID of the online archive.
- id str
- The provider-assigned unique ID for this managed resource.
- state str
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
Look up Existing OnlineArchive Resource
Get an existing OnlineArchive resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: OnlineArchiveState, opts?: CustomResourceOptions): OnlineArchive
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
archive_id: Optional[str] = None,
cluster_name: Optional[str] = None,
coll_name: Optional[str] = None,
collection_type: Optional[str] = None,
criteria: Optional[OnlineArchiveCriteriaArgs] = None,
data_expiration_rule: Optional[OnlineArchiveDataExpirationRuleArgs] = None,
data_process_region: Optional[OnlineArchiveDataProcessRegionArgs] = None,
db_name: Optional[str] = None,
partition_fields: Optional[Sequence[OnlineArchivePartitionFieldArgs]] = None,
paused: Optional[bool] = None,
project_id: Optional[str] = None,
schedule: Optional[OnlineArchiveScheduleArgs] = None,
state: Optional[str] = None,
sync_creation: Optional[bool] = None) -> OnlineArchive
func GetOnlineArchive(ctx *Context, name string, id IDInput, state *OnlineArchiveState, opts ...ResourceOption) (*OnlineArchive, error)
public static OnlineArchive Get(string name, Input<string> id, OnlineArchiveState? state, CustomResourceOptions? opts = null)
public static OnlineArchive get(String name, Output<String> id, OnlineArchiveState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Archive
Id string - ID of the online archive.
- Cluster
Name string - Name of the cluster that contains the collection.
- Coll
Name string - Name of the collection.
- Collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- Criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- Data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- Data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- Db
Name string - Name of the database that contains the collection.
- Partition
Fields List<OnlineArchive Partition Field> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - Paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- Project
Id string - The unique ID for the project
- Schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- State string
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- Sync
Creation bool
- Archive
Id string - ID of the online archive.
- Cluster
Name string - Name of the cluster that contains the collection.
- Coll
Name string - Name of the collection.
- Collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- Criteria
Online
Archive Criteria Args - Criteria to use for archiving data. See criteria.
- Data
Expiration OnlineRule Archive Data Expiration Rule Args - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- Data
Process OnlineRegion Archive Data Process Region Args - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- Db
Name string - Name of the database that contains the collection.
- Partition
Fields []OnlineArchive Partition Field Args - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - Paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- Project
Id string - The unique ID for the project
- Schedule
Online
Archive Schedule Args - Regular frequency and duration when archiving process occurs. See schedule.
- State string
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- Sync
Creation bool
- archive
Id String - ID of the online archive.
- cluster
Name String - Name of the cluster that contains the collection.
- coll
Name String - Name of the collection.
- collection
Type String - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- db
Name String - Name of the database that contains the collection.
- partition
Fields List<OnlineArchive Partition Field> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused Boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- project
Id String - The unique ID for the project
- schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- state String
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- sync
Creation Boolean
- archive
Id string - ID of the online archive.
- cluster
Name string - Name of the cluster that contains the collection.
- coll
Name string - Name of the collection.
- collection
Type string - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- criteria
Online
Archive Criteria - Criteria to use for archiving data. See criteria.
- data
Expiration OnlineRule Archive Data Expiration Rule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process OnlineRegion Archive Data Process Region - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- db
Name string - Name of the database that contains the collection.
- partition
Fields OnlineArchive Partition Field[] - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- project
Id string - The unique ID for the project
- schedule
Online
Archive Schedule - Regular frequency and duration when archiving process occurs. See schedule.
- state string
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- sync
Creation boolean
- archive_
id str - ID of the online archive.
- cluster_
name str - Name of the cluster that contains the collection.
- coll_
name str - Name of the collection.
- collection_
type str - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- criteria
Online
Archive Criteria Args - Criteria to use for archiving data. See criteria.
- data_
expiration_ Onlinerule Archive Data Expiration Rule Args - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data_
process_ Onlineregion Archive Data Process Region Args - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- db_
name str - Name of the database that contains the collection.
- partition_
fields Sequence[OnlineArchive Partition Field Args] - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused bool
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- project_
id str - The unique ID for the project
- schedule
Online
Archive Schedule Args - Regular frequency and duration when archiving process occurs. See schedule.
- state str
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- sync_
creation bool
- archive
Id String - ID of the online archive.
- cluster
Name String - Name of the cluster that contains the collection.
- coll
Name String - Name of the collection.
- collection
Type String - Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
- criteria Property Map
- Criteria to use for archiving data. See criteria.
- data
Expiration Property MapRule - Rule for specifying when data should be deleted from the archive. See data expiration rule.
- data
Process Property MapRegion - Settings to configure the region where you wish to store your archived data. See data process region. This field is immutable hence cannot be updated.
- db
Name String - Name of the database that contains the collection.
- partition
Fields List<Property Map> - Fields to use to partition data. You can specify up to two frequently queried fields (or up to three fields when one of them is
date_field
) to use for partitioning data. Queries that don’t contain the specified fields require a full collection scan of all archived documents, which takes longer and increases your costs. To learn more about how partition improves query performance, see Data Structure in S3. The value of a partition field can be up to a maximum of 700 characters. Documents with values exceeding 700 characters are not archived. See partition fields. - paused Boolean
- State of the online archive. This is required for pausing an active online archive or resuming a paused online archive. If the collection has another active online archive, the resume request fails.
- project
Id String - The unique ID for the project
- schedule Property Map
- Regular frequency and duration when archiving process occurs. See schedule.
- state String
- Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
- sync
Creation Boolean
Supporting Types
OnlineArchiveCriteria, OnlineArchiveCriteriaArgs
- Type string
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- Date
Field string - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- Date
Format string - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - Expire
After intDays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- Query string
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
- Type string
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- Date
Field string - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- Date
Format string - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - Expire
After intDays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- Query string
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
- type String
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- date
Field String - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- date
Format String - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - expire
After IntegerDays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- query String
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
- type string
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- date
Field string - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- date
Format string - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - expire
After numberDays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- query string
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
- type str
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- date_
field str - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- date_
format str - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - expire_
after_ intdays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- query str
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
- type String
Type of criteria (DATE, CUSTOM)
The following fields are required for criteria type
DATE
- date
Field String - Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the expireAfterDays parameter.
- date
Format String - Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601 or Epoch timestamps. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. You must set
type
toDATE
ifcollectionType
isTIMESERIES
. Valid values: ISODATE (default), EPOCH_SECONDS, EPOCH_MILLIS, EPOCH_NANOSECONDS. - expire
After NumberDays Number of days after the value in the criteria.dateField when MongoDB Cloud archives data in the specified cluster.
NOTE: if
DATE
is selected, thepartition_fields.field_name
must be completed with thedate_field
valueThe only field required for criteria type
CUSTOM
- query String
- JSON query to use to select documents for archiving. Atlas uses the specified query with the db.collection.find(query) command. The empty document {} to return all documents is not supported.
OnlineArchiveDataExpirationRule, OnlineArchiveDataExpirationRuleArgs
- Expire
After intDays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
- Expire
After intDays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
- expire
After IntegerDays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
- expire
After numberDays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
- expire_
after_ intdays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
- expire
After NumberDays - Number of days used in the date criteria for nominating documents for deletion. Value must be between 7 and 9215.
OnlineArchiveDataProcessRegion, OnlineArchiveDataProcessRegionArgs
- Cloud
Provider string - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - Region string
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
- Cloud
Provider string - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - Region string
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
- cloud
Provider String - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - region String
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
- cloud
Provider string - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - region string
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
- cloud_
provider str - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - region str
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
- cloud
Provider String - Human-readable label that identifies the Cloud service provider where you wish to store your archived data.
AZURE
may be selected only if Azure is the Cloud service provider for the cluster and no AWS online archive has been created for the cluster. - region String
- Human-readable label that identifies the geographic location of the region where you wish to store your archived data. For allowed values, see MongoDB Atlas API documentation
OnlineArchivePartitionField, OnlineArchivePartitionFieldArgs
- field_
name str - order int
- field_
type str
OnlineArchiveSchedule, OnlineArchiveScheduleArgs
- Type string
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - Day
Of intMonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - Day
Of intWeek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - End
Hour int - Hour of the day when the scheduled window to run one online archive ends.
- End
Minute int - Minute of the hour when the scheduled window to run one online archive ends.
- Start
Hour int - Hour of the day when the when the scheduled window to run one online archive starts.
- Start
Minute int - Minute of the hour when the scheduled window to run one online archive starts.
- Type string
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - Day
Of intMonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - Day
Of intWeek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - End
Hour int - Hour of the day when the scheduled window to run one online archive ends.
- End
Minute int - Minute of the hour when the scheduled window to run one online archive ends.
- Start
Hour int - Hour of the day when the when the scheduled window to run one online archive starts.
- Start
Minute int - Minute of the hour when the scheduled window to run one online archive starts.
- type String
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - day
Of IntegerMonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - day
Of IntegerWeek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - end
Hour Integer - Hour of the day when the scheduled window to run one online archive ends.
- end
Minute Integer - Minute of the hour when the scheduled window to run one online archive ends.
- start
Hour Integer - Hour of the day when the when the scheduled window to run one online archive starts.
- start
Minute Integer - Minute of the hour when the scheduled window to run one online archive starts.
- type string
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - day
Of numberMonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - day
Of numberWeek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - end
Hour number - Hour of the day when the scheduled window to run one online archive ends.
- end
Minute number - Minute of the hour when the scheduled window to run one online archive ends.
- start
Hour number - Hour of the day when the when the scheduled window to run one online archive starts.
- start
Minute number - Minute of the hour when the scheduled window to run one online archive starts.
- type str
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - day_
of_ intmonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - day_
of_ intweek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - end_
hour int - Hour of the day when the scheduled window to run one online archive ends.
- end_
minute int - Minute of the hour when the scheduled window to run one online archive ends.
- start_
hour int - Hour of the day when the when the scheduled window to run one online archive starts.
- start_
minute int - Minute of the hour when the scheduled window to run one online archive starts.
- type String
- Type of schedule (``DAILY
,
MONTHLY,
WEEKLY`). - day
Of NumberMonth - Day of the month when the scheduled archive starts. This field should be provided only when schedule
type
isMONTHLY
. - day
Of NumberWeek - Day of the week when the scheduled archive starts. The week starts with Monday (1) and ends with Sunday (7). This field should be provided only when schedule
type
isWEEKLY
. - end
Hour Number - Hour of the day when the scheduled window to run one online archive ends.
- end
Minute Number - Minute of the hour when the scheduled window to run one online archive ends.
- start
Hour Number - Hour of the day when the when the scheduled window to run one online archive starts.
- start
Minute Number - Minute of the hour when the scheduled window to run one online archive starts.
Import
terraform import mongodbatlas_online_archive.users_archive <project_id>-<cluster_name>-<archive_id>
See MongoDB Atlas API Documentation for more information.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.