/
onlineArchive.go
525 lines (465 loc) · 26.1 KB
/
onlineArchive.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package mongodbatlas
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `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 groupId 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 `dateField` 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 error `ONLINE_ARCHIVE_CANNOT_MODIFY_FIELD`
//
// ## Example Usage
//
// ### S
// <!--Start PulumiCodeChooser -->
// ```go
// 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(_var.Project_id),
// ClusterName: pulumi.Any(_var.Cluster_name),
// CollName: pulumi.Any(_var.Collection_name),
// DbName: pulumi.Any(_var.Database_name),
// 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
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// # For custom criteria example
//
// <!--Start PulumiCodeChooser -->
// ```go
// 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(_var.Project_id),
// ClusterName: pulumi.Any(_var.Cluster_name),
// CollName: pulumi.Any(_var.Collection_name),
// DbName: pulumi.Any(_var.Database_name),
// 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
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// See [MongoDB Atlas API](https://docs.atlas.mongodb.com/reference/api/online-archive-create-one/) Documentation for more information.
type OnlineArchive struct {
pulumi.CustomResourceState
// ID of the online archive.
ArchiveId pulumi.StringOutput `pulumi:"archiveId"`
// Name of the cluster that contains the collection.
ClusterName pulumi.StringOutput `pulumi:"clusterName"`
// Name of the collection.
CollName pulumi.StringOutput `pulumi:"collName"`
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
CollectionType pulumi.StringOutput `pulumi:"collectionType"`
// Criteria to use for archiving data. See criteria.
Criteria OnlineArchiveCriteriaOutput `pulumi:"criteria"`
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
DataExpirationRule OnlineArchiveDataExpirationRulePtrOutput `pulumi:"dataExpirationRule"`
// 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.
DataProcessRegion OnlineArchiveDataProcessRegionOutput `pulumi:"dataProcessRegion"`
// Name of the database that contains the collection.
DbName pulumi.StringOutput `pulumi:"dbName"`
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
PartitionFields OnlineArchivePartitionFieldArrayOutput `pulumi:"partitionFields"`
// 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.
Paused pulumi.BoolOutput `pulumi:"paused"`
// The unique ID for the project
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// Regular frequency and duration when archiving process occurs. See schedule.
Schedule OnlineArchiveSchedulePtrOutput `pulumi:"schedule"`
// Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
State pulumi.StringOutput `pulumi:"state"`
SyncCreation pulumi.BoolPtrOutput `pulumi:"syncCreation"`
}
// NewOnlineArchive registers a new resource with the given unique name, arguments, and options.
func NewOnlineArchive(ctx *pulumi.Context,
name string, args *OnlineArchiveArgs, opts ...pulumi.ResourceOption) (*OnlineArchive, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterName == nil {
return nil, errors.New("invalid value for required argument 'ClusterName'")
}
if args.CollName == nil {
return nil, errors.New("invalid value for required argument 'CollName'")
}
if args.Criteria == nil {
return nil, errors.New("invalid value for required argument 'Criteria'")
}
if args.DbName == nil {
return nil, errors.New("invalid value for required argument 'DbName'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource OnlineArchive
err := ctx.RegisterResource("mongodbatlas:index/onlineArchive:OnlineArchive", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetOnlineArchive gets an existing OnlineArchive resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetOnlineArchive(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *OnlineArchiveState, opts ...pulumi.ResourceOption) (*OnlineArchive, error) {
var resource OnlineArchive
err := ctx.ReadResource("mongodbatlas:index/onlineArchive:OnlineArchive", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering OnlineArchive resources.
type onlineArchiveState struct {
// ID of the online archive.
ArchiveId *string `pulumi:"archiveId"`
// Name of the cluster that contains the collection.
ClusterName *string `pulumi:"clusterName"`
// Name of the collection.
CollName *string `pulumi:"collName"`
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
CollectionType *string `pulumi:"collectionType"`
// Criteria to use for archiving data. See criteria.
Criteria *OnlineArchiveCriteria `pulumi:"criteria"`
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
DataExpirationRule *OnlineArchiveDataExpirationRule `pulumi:"dataExpirationRule"`
// 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.
DataProcessRegion *OnlineArchiveDataProcessRegion `pulumi:"dataProcessRegion"`
// Name of the database that contains the collection.
DbName *string `pulumi:"dbName"`
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
PartitionFields []OnlineArchivePartitionField `pulumi:"partitionFields"`
// 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.
Paused *bool `pulumi:"paused"`
// The unique ID for the project
ProjectId *string `pulumi:"projectId"`
// Regular frequency and duration when archiving process occurs. See schedule.
Schedule *OnlineArchiveSchedule `pulumi:"schedule"`
// Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
State *string `pulumi:"state"`
SyncCreation *bool `pulumi:"syncCreation"`
}
type OnlineArchiveState struct {
// ID of the online archive.
ArchiveId pulumi.StringPtrInput
// Name of the cluster that contains the collection.
ClusterName pulumi.StringPtrInput
// Name of the collection.
CollName pulumi.StringPtrInput
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
CollectionType pulumi.StringPtrInput
// Criteria to use for archiving data. See criteria.
Criteria OnlineArchiveCriteriaPtrInput
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
DataExpirationRule OnlineArchiveDataExpirationRulePtrInput
// 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.
DataProcessRegion OnlineArchiveDataProcessRegionPtrInput
// Name of the database that contains the collection.
DbName pulumi.StringPtrInput
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
PartitionFields OnlineArchivePartitionFieldArrayInput
// 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.
Paused pulumi.BoolPtrInput
// The unique ID for the project
ProjectId pulumi.StringPtrInput
// Regular frequency and duration when archiving process occurs. See schedule.
Schedule OnlineArchiveSchedulePtrInput
// Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
State pulumi.StringPtrInput
SyncCreation pulumi.BoolPtrInput
}
func (OnlineArchiveState) ElementType() reflect.Type {
return reflect.TypeOf((*onlineArchiveState)(nil)).Elem()
}
type onlineArchiveArgs struct {
// Name of the cluster that contains the collection.
ClusterName string `pulumi:"clusterName"`
// Name of the collection.
CollName string `pulumi:"collName"`
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
CollectionType *string `pulumi:"collectionType"`
// Criteria to use for archiving data. See criteria.
Criteria OnlineArchiveCriteria `pulumi:"criteria"`
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
DataExpirationRule *OnlineArchiveDataExpirationRule `pulumi:"dataExpirationRule"`
// 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.
DataProcessRegion *OnlineArchiveDataProcessRegion `pulumi:"dataProcessRegion"`
// Name of the database that contains the collection.
DbName string `pulumi:"dbName"`
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
PartitionFields []OnlineArchivePartitionField `pulumi:"partitionFields"`
// 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.
Paused *bool `pulumi:"paused"`
// The unique ID for the project
ProjectId string `pulumi:"projectId"`
// Regular frequency and duration when archiving process occurs. See schedule.
Schedule *OnlineArchiveSchedule `pulumi:"schedule"`
SyncCreation *bool `pulumi:"syncCreation"`
}
// The set of arguments for constructing a OnlineArchive resource.
type OnlineArchiveArgs struct {
// Name of the cluster that contains the collection.
ClusterName pulumi.StringInput
// Name of the collection.
CollName pulumi.StringInput
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
CollectionType pulumi.StringPtrInput
// Criteria to use for archiving data. See criteria.
Criteria OnlineArchiveCriteriaInput
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
DataExpirationRule OnlineArchiveDataExpirationRulePtrInput
// 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.
DataProcessRegion OnlineArchiveDataProcessRegionPtrInput
// Name of the database that contains the collection.
DbName pulumi.StringInput
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
PartitionFields OnlineArchivePartitionFieldArrayInput
// 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.
Paused pulumi.BoolPtrInput
// The unique ID for the project
ProjectId pulumi.StringInput
// Regular frequency and duration when archiving process occurs. See schedule.
Schedule OnlineArchiveSchedulePtrInput
SyncCreation pulumi.BoolPtrInput
}
func (OnlineArchiveArgs) ElementType() reflect.Type {
return reflect.TypeOf((*onlineArchiveArgs)(nil)).Elem()
}
type OnlineArchiveInput interface {
pulumi.Input
ToOnlineArchiveOutput() OnlineArchiveOutput
ToOnlineArchiveOutputWithContext(ctx context.Context) OnlineArchiveOutput
}
func (*OnlineArchive) ElementType() reflect.Type {
return reflect.TypeOf((**OnlineArchive)(nil)).Elem()
}
func (i *OnlineArchive) ToOnlineArchiveOutput() OnlineArchiveOutput {
return i.ToOnlineArchiveOutputWithContext(context.Background())
}
func (i *OnlineArchive) ToOnlineArchiveOutputWithContext(ctx context.Context) OnlineArchiveOutput {
return pulumi.ToOutputWithContext(ctx, i).(OnlineArchiveOutput)
}
// OnlineArchiveArrayInput is an input type that accepts OnlineArchiveArray and OnlineArchiveArrayOutput values.
// You can construct a concrete instance of `OnlineArchiveArrayInput` via:
//
// OnlineArchiveArray{ OnlineArchiveArgs{...} }
type OnlineArchiveArrayInput interface {
pulumi.Input
ToOnlineArchiveArrayOutput() OnlineArchiveArrayOutput
ToOnlineArchiveArrayOutputWithContext(context.Context) OnlineArchiveArrayOutput
}
type OnlineArchiveArray []OnlineArchiveInput
func (OnlineArchiveArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*OnlineArchive)(nil)).Elem()
}
func (i OnlineArchiveArray) ToOnlineArchiveArrayOutput() OnlineArchiveArrayOutput {
return i.ToOnlineArchiveArrayOutputWithContext(context.Background())
}
func (i OnlineArchiveArray) ToOnlineArchiveArrayOutputWithContext(ctx context.Context) OnlineArchiveArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(OnlineArchiveArrayOutput)
}
// OnlineArchiveMapInput is an input type that accepts OnlineArchiveMap and OnlineArchiveMapOutput values.
// You can construct a concrete instance of `OnlineArchiveMapInput` via:
//
// OnlineArchiveMap{ "key": OnlineArchiveArgs{...} }
type OnlineArchiveMapInput interface {
pulumi.Input
ToOnlineArchiveMapOutput() OnlineArchiveMapOutput
ToOnlineArchiveMapOutputWithContext(context.Context) OnlineArchiveMapOutput
}
type OnlineArchiveMap map[string]OnlineArchiveInput
func (OnlineArchiveMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*OnlineArchive)(nil)).Elem()
}
func (i OnlineArchiveMap) ToOnlineArchiveMapOutput() OnlineArchiveMapOutput {
return i.ToOnlineArchiveMapOutputWithContext(context.Background())
}
func (i OnlineArchiveMap) ToOnlineArchiveMapOutputWithContext(ctx context.Context) OnlineArchiveMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(OnlineArchiveMapOutput)
}
type OnlineArchiveOutput struct{ *pulumi.OutputState }
func (OnlineArchiveOutput) ElementType() reflect.Type {
return reflect.TypeOf((**OnlineArchive)(nil)).Elem()
}
func (o OnlineArchiveOutput) ToOnlineArchiveOutput() OnlineArchiveOutput {
return o
}
func (o OnlineArchiveOutput) ToOnlineArchiveOutputWithContext(ctx context.Context) OnlineArchiveOutput {
return o
}
// ID of the online archive.
func (o OnlineArchiveOutput) ArchiveId() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.ArchiveId }).(pulumi.StringOutput)
}
// Name of the cluster that contains the collection.
func (o OnlineArchiveOutput) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.ClusterName }).(pulumi.StringOutput)
}
// Name of the collection.
func (o OnlineArchiveOutput) CollName() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.CollName }).(pulumi.StringOutput)
}
// Type of MongoDB collection that you want to return. This value can be "TIMESERIES" or "STANDARD". Default is "STANDARD".
func (o OnlineArchiveOutput) CollectionType() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.CollectionType }).(pulumi.StringOutput)
}
// Criteria to use for archiving data. See criteria.
func (o OnlineArchiveOutput) Criteria() OnlineArchiveCriteriaOutput {
return o.ApplyT(func(v *OnlineArchive) OnlineArchiveCriteriaOutput { return v.Criteria }).(OnlineArchiveCriteriaOutput)
}
// Rule for specifying when data should be deleted from the archive. See data expiration rule.
func (o OnlineArchiveOutput) DataExpirationRule() OnlineArchiveDataExpirationRulePtrOutput {
return o.ApplyT(func(v *OnlineArchive) OnlineArchiveDataExpirationRulePtrOutput { return v.DataExpirationRule }).(OnlineArchiveDataExpirationRulePtrOutput)
}
// 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.
func (o OnlineArchiveOutput) DataProcessRegion() OnlineArchiveDataProcessRegionOutput {
return o.ApplyT(func(v *OnlineArchive) OnlineArchiveDataProcessRegionOutput { return v.DataProcessRegion }).(OnlineArchiveDataProcessRegionOutput)
}
// Name of the database that contains the collection.
func (o OnlineArchiveOutput) DbName() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.DbName }).(pulumi.StringOutput)
}
// 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 `dateField`) 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](https://docs.mongodb.com/datalake/admin/optimize-query-performance/#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.
func (o OnlineArchiveOutput) PartitionFields() OnlineArchivePartitionFieldArrayOutput {
return o.ApplyT(func(v *OnlineArchive) OnlineArchivePartitionFieldArrayOutput { return v.PartitionFields }).(OnlineArchivePartitionFieldArrayOutput)
}
// 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.
func (o OnlineArchiveOutput) Paused() pulumi.BoolOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.BoolOutput { return v.Paused }).(pulumi.BoolOutput)
}
// The unique ID for the project
func (o OnlineArchiveOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// Regular frequency and duration when archiving process occurs. See schedule.
func (o OnlineArchiveOutput) Schedule() OnlineArchiveSchedulePtrOutput {
return o.ApplyT(func(v *OnlineArchive) OnlineArchiveSchedulePtrOutput { return v.Schedule }).(OnlineArchiveSchedulePtrOutput)
}
// Status of the online archive. Valid values are: Pending, Archiving, Idle, Pausing, Paused, Orphaned and Deleted
func (o OnlineArchiveOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
func (o OnlineArchiveOutput) SyncCreation() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *OnlineArchive) pulumi.BoolPtrOutput { return v.SyncCreation }).(pulumi.BoolPtrOutput)
}
type OnlineArchiveArrayOutput struct{ *pulumi.OutputState }
func (OnlineArchiveArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*OnlineArchive)(nil)).Elem()
}
func (o OnlineArchiveArrayOutput) ToOnlineArchiveArrayOutput() OnlineArchiveArrayOutput {
return o
}
func (o OnlineArchiveArrayOutput) ToOnlineArchiveArrayOutputWithContext(ctx context.Context) OnlineArchiveArrayOutput {
return o
}
func (o OnlineArchiveArrayOutput) Index(i pulumi.IntInput) OnlineArchiveOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OnlineArchive {
return vs[0].([]*OnlineArchive)[vs[1].(int)]
}).(OnlineArchiveOutput)
}
type OnlineArchiveMapOutput struct{ *pulumi.OutputState }
func (OnlineArchiveMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*OnlineArchive)(nil)).Elem()
}
func (o OnlineArchiveMapOutput) ToOnlineArchiveMapOutput() OnlineArchiveMapOutput {
return o
}
func (o OnlineArchiveMapOutput) ToOnlineArchiveMapOutputWithContext(ctx context.Context) OnlineArchiveMapOutput {
return o
}
func (o OnlineArchiveMapOutput) MapIndex(k pulumi.StringInput) OnlineArchiveOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OnlineArchive {
return vs[0].(map[string]*OnlineArchive)[vs[1].(string)]
}).(OnlineArchiveOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*OnlineArchiveInput)(nil)).Elem(), &OnlineArchive{})
pulumi.RegisterInputType(reflect.TypeOf((*OnlineArchiveArrayInput)(nil)).Elem(), OnlineArchiveArray{})
pulumi.RegisterInputType(reflect.TypeOf((*OnlineArchiveMapInput)(nil)).Elem(), OnlineArchiveMap{})
pulumi.RegisterOutputType(OnlineArchiveOutput{})
pulumi.RegisterOutputType(OnlineArchiveArrayOutput{})
pulumi.RegisterOutputType(OnlineArchiveMapOutput{})
}