/
getOpenZfsSnapshot.go
195 lines (171 loc) · 7 KB
/
getOpenZfsSnapshot.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
// 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 fsx
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get information about an Amazon FSx for OpenZFS Snapshot for use when provisioning new Volumes.
//
// ## Example Usage
//
// ### Root volume Example
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/fsx"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := fsx.LookupOpenZfsSnapshot(ctx, &fsx.LookupOpenZfsSnapshotArgs{
// MostRecent: pulumi.BoolRef(true),
// Filters: []fsx.GetOpenZfsSnapshotFilter{
// {
// Name: "volume-id",
// Values: []string{
// "fsvol-073a32b6098a73feb",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupOpenZfsSnapshot(ctx *pulumi.Context, args *LookupOpenZfsSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupOpenZfsSnapshotResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupOpenZfsSnapshotResult
err := ctx.Invoke("aws:fsx/getOpenZfsSnapshot:getOpenZfsSnapshot", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getOpenZfsSnapshot.
type LookupOpenZfsSnapshotArgs struct {
// One or more name/value pairs to filter off of. The
// supported names are file-system-id or volume-id.
Filters []GetOpenZfsSnapshotFilter `pulumi:"filters"`
// If more than one result is returned, use the most recent snapshot.
MostRecent *bool `pulumi:"mostRecent"`
// Name of the snapshot.
Name *string `pulumi:"name"`
// Returns information on a specific snapshot_id.
SnapshotIds []string `pulumi:"snapshotIds"`
// List of Tag values, with a maximum of 50 elements.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getOpenZfsSnapshot.
type LookupOpenZfsSnapshotResult struct {
// Amazon Resource Name of the snapshot.
Arn string `pulumi:"arn"`
// Time that the resource was created.
CreationTime string `pulumi:"creationTime"`
Filters []GetOpenZfsSnapshotFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
MostRecent *bool `pulumi:"mostRecent"`
// Name of the snapshot.
Name *string `pulumi:"name"`
// ID of the snapshot.
SnapshotId string `pulumi:"snapshotId"`
SnapshotIds []string `pulumi:"snapshotIds"`
// List of Tag values, with a maximum of 50 elements.
Tags map[string]string `pulumi:"tags"`
// ID of the volume that the snapshot is of.
VolumeId string `pulumi:"volumeId"`
}
func LookupOpenZfsSnapshotOutput(ctx *pulumi.Context, args LookupOpenZfsSnapshotOutputArgs, opts ...pulumi.InvokeOption) LookupOpenZfsSnapshotResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupOpenZfsSnapshotResult, error) {
args := v.(LookupOpenZfsSnapshotArgs)
r, err := LookupOpenZfsSnapshot(ctx, &args, opts...)
var s LookupOpenZfsSnapshotResult
if r != nil {
s = *r
}
return s, err
}).(LookupOpenZfsSnapshotResultOutput)
}
// A collection of arguments for invoking getOpenZfsSnapshot.
type LookupOpenZfsSnapshotOutputArgs struct {
// One or more name/value pairs to filter off of. The
// supported names are file-system-id or volume-id.
Filters GetOpenZfsSnapshotFilterArrayInput `pulumi:"filters"`
// If more than one result is returned, use the most recent snapshot.
MostRecent pulumi.BoolPtrInput `pulumi:"mostRecent"`
// Name of the snapshot.
Name pulumi.StringPtrInput `pulumi:"name"`
// Returns information on a specific snapshot_id.
SnapshotIds pulumi.StringArrayInput `pulumi:"snapshotIds"`
// List of Tag values, with a maximum of 50 elements.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupOpenZfsSnapshotOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOpenZfsSnapshotArgs)(nil)).Elem()
}
// A collection of values returned by getOpenZfsSnapshot.
type LookupOpenZfsSnapshotResultOutput struct{ *pulumi.OutputState }
func (LookupOpenZfsSnapshotResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOpenZfsSnapshotResult)(nil)).Elem()
}
func (o LookupOpenZfsSnapshotResultOutput) ToLookupOpenZfsSnapshotResultOutput() LookupOpenZfsSnapshotResultOutput {
return o
}
func (o LookupOpenZfsSnapshotResultOutput) ToLookupOpenZfsSnapshotResultOutputWithContext(ctx context.Context) LookupOpenZfsSnapshotResultOutput {
return o
}
// Amazon Resource Name of the snapshot.
func (o LookupOpenZfsSnapshotResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.Arn }).(pulumi.StringOutput)
}
// Time that the resource was created.
func (o LookupOpenZfsSnapshotResultOutput) CreationTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.CreationTime }).(pulumi.StringOutput)
}
func (o LookupOpenZfsSnapshotResultOutput) Filters() GetOpenZfsSnapshotFilterArrayOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) []GetOpenZfsSnapshotFilter { return v.Filters }).(GetOpenZfsSnapshotFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupOpenZfsSnapshotResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupOpenZfsSnapshotResultOutput) MostRecent() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) *bool { return v.MostRecent }).(pulumi.BoolPtrOutput)
}
// Name of the snapshot.
func (o LookupOpenZfsSnapshotResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// ID of the snapshot.
func (o LookupOpenZfsSnapshotResultOutput) SnapshotId() pulumi.StringOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.SnapshotId }).(pulumi.StringOutput)
}
func (o LookupOpenZfsSnapshotResultOutput) SnapshotIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) []string { return v.SnapshotIds }).(pulumi.StringArrayOutput)
}
// List of Tag values, with a maximum of 50 elements.
func (o LookupOpenZfsSnapshotResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// ID of the volume that the snapshot is of.
func (o LookupOpenZfsSnapshotResultOutput) VolumeId() pulumi.StringOutput {
return o.ApplyT(func(v LookupOpenZfsSnapshotResult) string { return v.VolumeId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupOpenZfsSnapshotResultOutput{})
}