/
getCloudBackupSnapshot.go
198 lines (167 loc) · 9.56 KB
/
getCloudBackupSnapshot.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
// 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"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `CloudBackupSnapshot` provides an Cloud Backup Snapshot datasource. Atlas Cloud Backup Snapshots provide localized backup storage using the native snapshot functionality of the cluster’s cloud service.
//
// > **NOTE:** Groups and projects are synonymous terms. You may find `groupId` in the official documentation.
func LookupCloudBackupSnapshot(ctx *pulumi.Context, args *LookupCloudBackupSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupCloudBackupSnapshotResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupCloudBackupSnapshotResult
err := ctx.Invoke("mongodbatlas:index/getCloudBackupSnapshot:getCloudBackupSnapshot", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCloudBackupSnapshot.
type LookupCloudBackupSnapshotArgs struct {
// The name of the Atlas cluster that contains the snapshot you want to retrieve.
ClusterName string `pulumi:"clusterName"`
// The unique identifier of the project for the Atlas cluster.
ProjectId string `pulumi:"projectId"`
// The unique identifier of the snapshot you want to retrieve.
SnapshotId string `pulumi:"snapshotId"`
}
// A collection of values returned by getCloudBackupSnapshot.
type LookupCloudBackupSnapshotResult struct {
// Cloud provider that stores this snapshot.
CloudProvider string `pulumi:"cloudProvider"`
ClusterName string `pulumi:"clusterName"`
// UTC ISO 8601 formatted point in time when Atlas took the snapshot.
CreatedAt string `pulumi:"createdAt"`
// UDescription of the snapshot. Only present for on-demand snapshots.
Description string `pulumi:"description"`
// UTC ISO 8601 formatted point in time when Atlas will delete the snapshot.
ExpiresAt string `pulumi:"expiresAt"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Unique ID of the AWS KMS Customer Master Key used to encrypt the snapshot. Only visible for clusters using Encryption at Rest via Customer KMS.
MasterKeyUuid string `pulumi:"masterKeyUuid"`
// Block of List of snapshots and the cloud provider where the snapshots are stored. See below
Members []GetCloudBackupSnapshotMember `pulumi:"members"`
// Version of the MongoDB server.
MongodVersion string `pulumi:"mongodVersion"`
ProjectId string `pulumi:"projectId"`
// Label given to a shard or config server from which Atlas took this snapshot.
ReplicaSetName string `pulumi:"replicaSetName"`
SnapshotId string `pulumi:"snapshotId"`
// Unique identifiers of the snapshots created for the shards and config server for a sharded cluster.
SnapshotIds []string `pulumi:"snapshotIds"`
// Specified the type of snapshot. Valid values are onDemand and scheduled.
SnapshotType string `pulumi:"snapshotType"`
// Current status of the snapshot. One of the following values: queued, inProgress, completed, failed.
Status string `pulumi:"status"`
// Specifies the size of the snapshot in bytes.
StorageSizeBytes int `pulumi:"storageSizeBytes"`
// Specifies the type of cluster: replicaSet or shardedCluster.
Type string `pulumi:"type"`
}
func LookupCloudBackupSnapshotOutput(ctx *pulumi.Context, args LookupCloudBackupSnapshotOutputArgs, opts ...pulumi.InvokeOption) LookupCloudBackupSnapshotResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCloudBackupSnapshotResult, error) {
args := v.(LookupCloudBackupSnapshotArgs)
r, err := LookupCloudBackupSnapshot(ctx, &args, opts...)
var s LookupCloudBackupSnapshotResult
if r != nil {
s = *r
}
return s, err
}).(LookupCloudBackupSnapshotResultOutput)
}
// A collection of arguments for invoking getCloudBackupSnapshot.
type LookupCloudBackupSnapshotOutputArgs struct {
// The name of the Atlas cluster that contains the snapshot you want to retrieve.
ClusterName pulumi.StringInput `pulumi:"clusterName"`
// The unique identifier of the project for the Atlas cluster.
ProjectId pulumi.StringInput `pulumi:"projectId"`
// The unique identifier of the snapshot you want to retrieve.
SnapshotId pulumi.StringInput `pulumi:"snapshotId"`
}
func (LookupCloudBackupSnapshotOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCloudBackupSnapshotArgs)(nil)).Elem()
}
// A collection of values returned by getCloudBackupSnapshot.
type LookupCloudBackupSnapshotResultOutput struct{ *pulumi.OutputState }
func (LookupCloudBackupSnapshotResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCloudBackupSnapshotResult)(nil)).Elem()
}
func (o LookupCloudBackupSnapshotResultOutput) ToLookupCloudBackupSnapshotResultOutput() LookupCloudBackupSnapshotResultOutput {
return o
}
func (o LookupCloudBackupSnapshotResultOutput) ToLookupCloudBackupSnapshotResultOutputWithContext(ctx context.Context) LookupCloudBackupSnapshotResultOutput {
return o
}
// Cloud provider that stores this snapshot.
func (o LookupCloudBackupSnapshotResultOutput) CloudProvider() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.CloudProvider }).(pulumi.StringOutput)
}
func (o LookupCloudBackupSnapshotResultOutput) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.ClusterName }).(pulumi.StringOutput)
}
// UTC ISO 8601 formatted point in time when Atlas took the snapshot.
func (o LookupCloudBackupSnapshotResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// UDescription of the snapshot. Only present for on-demand snapshots.
func (o LookupCloudBackupSnapshotResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.Description }).(pulumi.StringOutput)
}
// UTC ISO 8601 formatted point in time when Atlas will delete the snapshot.
func (o LookupCloudBackupSnapshotResultOutput) ExpiresAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.ExpiresAt }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupCloudBackupSnapshotResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.Id }).(pulumi.StringOutput)
}
// Unique ID of the AWS KMS Customer Master Key used to encrypt the snapshot. Only visible for clusters using Encryption at Rest via Customer KMS.
func (o LookupCloudBackupSnapshotResultOutput) MasterKeyUuid() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.MasterKeyUuid }).(pulumi.StringOutput)
}
// Block of List of snapshots and the cloud provider where the snapshots are stored. See below
func (o LookupCloudBackupSnapshotResultOutput) Members() GetCloudBackupSnapshotMemberArrayOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) []GetCloudBackupSnapshotMember { return v.Members }).(GetCloudBackupSnapshotMemberArrayOutput)
}
// Version of the MongoDB server.
func (o LookupCloudBackupSnapshotResultOutput) MongodVersion() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.MongodVersion }).(pulumi.StringOutput)
}
func (o LookupCloudBackupSnapshotResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.ProjectId }).(pulumi.StringOutput)
}
// Label given to a shard or config server from which Atlas took this snapshot.
func (o LookupCloudBackupSnapshotResultOutput) ReplicaSetName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.ReplicaSetName }).(pulumi.StringOutput)
}
func (o LookupCloudBackupSnapshotResultOutput) SnapshotId() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.SnapshotId }).(pulumi.StringOutput)
}
// Unique identifiers of the snapshots created for the shards and config server for a sharded cluster.
func (o LookupCloudBackupSnapshotResultOutput) SnapshotIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) []string { return v.SnapshotIds }).(pulumi.StringArrayOutput)
}
// Specified the type of snapshot. Valid values are onDemand and scheduled.
func (o LookupCloudBackupSnapshotResultOutput) SnapshotType() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.SnapshotType }).(pulumi.StringOutput)
}
// Current status of the snapshot. One of the following values: queued, inProgress, completed, failed.
func (o LookupCloudBackupSnapshotResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.Status }).(pulumi.StringOutput)
}
// Specifies the size of the snapshot in bytes.
func (o LookupCloudBackupSnapshotResultOutput) StorageSizeBytes() pulumi.IntOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) int { return v.StorageSizeBytes }).(pulumi.IntOutput)
}
// Specifies the type of cluster: replicaSet or shardedCluster.
func (o LookupCloudBackupSnapshotResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupCloudBackupSnapshotResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCloudBackupSnapshotResultOutput{})
}