generated from pulumi/pulumi-tf-provider-boilerplate
/
instanceSnapshot.go
227 lines (194 loc) · 8.16 KB
/
instanceSnapshot.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
// 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 scaleway
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type InstanceSnapshot struct {
pulumi.CustomResourceState
// The date and time of the creation of the snapshot
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// The name of the snapshot
Name pulumi.StringOutput `pulumi:"name"`
// The organization_id you want to attach the resource to
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// The project_id you want to attach the resource to
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// The size of the snapshot in gigabyte
SizeInGb pulumi.IntOutput `pulumi:"sizeInGb"`
// The tags associated with the snapshot
Tags pulumi.StringArrayOutput `pulumi:"tags"`
// The volume type of the snapshot
Type pulumi.StringOutput `pulumi:"type"`
// ID of the volume to take a snapshot from
VolumeId pulumi.StringOutput `pulumi:"volumeId"`
// The zone you want to attach the resource to
Zone pulumi.StringOutput `pulumi:"zone"`
}
// NewInstanceSnapshot registers a new resource with the given unique name, arguments, and options.
func NewInstanceSnapshot(ctx *pulumi.Context,
name string, args *InstanceSnapshotArgs, opts ...pulumi.ResourceOption) (*InstanceSnapshot, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VolumeId == nil {
return nil, errors.New("invalid value for required argument 'VolumeId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource InstanceSnapshot
err := ctx.RegisterResource("scaleway:index/instanceSnapshot:InstanceSnapshot", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstanceSnapshot gets an existing InstanceSnapshot 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 GetInstanceSnapshot(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstanceSnapshotState, opts ...pulumi.ResourceOption) (*InstanceSnapshot, error) {
var resource InstanceSnapshot
err := ctx.ReadResource("scaleway:index/instanceSnapshot:InstanceSnapshot", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering InstanceSnapshot resources.
type instanceSnapshotState struct {
// The date and time of the creation of the snapshot
CreatedAt *string `pulumi:"createdAt"`
// The name of the snapshot
Name *string `pulumi:"name"`
// The organization_id you want to attach the resource to
OrganizationId *string `pulumi:"organizationId"`
// The project_id you want to attach the resource to
ProjectId *string `pulumi:"projectId"`
// The size of the snapshot in gigabyte
SizeInGb *int `pulumi:"sizeInGb"`
// The tags associated with the snapshot
Tags []string `pulumi:"tags"`
// The volume type of the snapshot
Type *string `pulumi:"type"`
// ID of the volume to take a snapshot from
VolumeId *string `pulumi:"volumeId"`
// The zone you want to attach the resource to
Zone *string `pulumi:"zone"`
}
type InstanceSnapshotState struct {
// The date and time of the creation of the snapshot
CreatedAt pulumi.StringPtrInput
// The name of the snapshot
Name pulumi.StringPtrInput
// The organization_id you want to attach the resource to
OrganizationId pulumi.StringPtrInput
// The project_id you want to attach the resource to
ProjectId pulumi.StringPtrInput
// The size of the snapshot in gigabyte
SizeInGb pulumi.IntPtrInput
// The tags associated with the snapshot
Tags pulumi.StringArrayInput
// The volume type of the snapshot
Type pulumi.StringPtrInput
// ID of the volume to take a snapshot from
VolumeId pulumi.StringPtrInput
// The zone you want to attach the resource to
Zone pulumi.StringPtrInput
}
func (InstanceSnapshotState) ElementType() reflect.Type {
return reflect.TypeOf((*instanceSnapshotState)(nil)).Elem()
}
type instanceSnapshotArgs struct {
// The name of the snapshot
Name *string `pulumi:"name"`
// The project_id you want to attach the resource to
ProjectId *string `pulumi:"projectId"`
// The tags associated with the snapshot
Tags []string `pulumi:"tags"`
// ID of the volume to take a snapshot from
VolumeId string `pulumi:"volumeId"`
// The zone you want to attach the resource to
Zone *string `pulumi:"zone"`
}
// The set of arguments for constructing a InstanceSnapshot resource.
type InstanceSnapshotArgs struct {
// The name of the snapshot
Name pulumi.StringPtrInput
// The project_id you want to attach the resource to
ProjectId pulumi.StringPtrInput
// The tags associated with the snapshot
Tags pulumi.StringArrayInput
// ID of the volume to take a snapshot from
VolumeId pulumi.StringInput
// The zone you want to attach the resource to
Zone pulumi.StringPtrInput
}
func (InstanceSnapshotArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instanceSnapshotArgs)(nil)).Elem()
}
type InstanceSnapshotInput interface {
pulumi.Input
ToInstanceSnapshotOutput() InstanceSnapshotOutput
ToInstanceSnapshotOutputWithContext(ctx context.Context) InstanceSnapshotOutput
}
func (*InstanceSnapshot) ElementType() reflect.Type {
return reflect.TypeOf((**InstanceSnapshot)(nil)).Elem()
}
func (i *InstanceSnapshot) ToInstanceSnapshotOutput() InstanceSnapshotOutput {
return i.ToInstanceSnapshotOutputWithContext(context.Background())
}
func (i *InstanceSnapshot) ToInstanceSnapshotOutputWithContext(ctx context.Context) InstanceSnapshotOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceSnapshotOutput)
}
type InstanceSnapshotOutput struct{ *pulumi.OutputState }
func (InstanceSnapshotOutput) ElementType() reflect.Type {
return reflect.TypeOf((**InstanceSnapshot)(nil)).Elem()
}
func (o InstanceSnapshotOutput) ToInstanceSnapshotOutput() InstanceSnapshotOutput {
return o
}
func (o InstanceSnapshotOutput) ToInstanceSnapshotOutputWithContext(ctx context.Context) InstanceSnapshotOutput {
return o
}
// The date and time of the creation of the snapshot
func (o InstanceSnapshotOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// The name of the snapshot
func (o InstanceSnapshotOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The organization_id you want to attach the resource to
func (o InstanceSnapshotOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// The project_id you want to attach the resource to
func (o InstanceSnapshotOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// The size of the snapshot in gigabyte
func (o InstanceSnapshotOutput) SizeInGb() pulumi.IntOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.IntOutput { return v.SizeInGb }).(pulumi.IntOutput)
}
// The tags associated with the snapshot
func (o InstanceSnapshotOutput) Tags() pulumi.StringArrayOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput)
}
// The volume type of the snapshot
func (o InstanceSnapshotOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// ID of the volume to take a snapshot from
func (o InstanceSnapshotOutput) VolumeId() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.VolumeId }).(pulumi.StringOutput)
}
// The zone you want to attach the resource to
func (o InstanceSnapshotOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceSnapshot) pulumi.StringOutput { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InstanceSnapshotInput)(nil)).Elem(), &InstanceSnapshot{})
pulumi.RegisterOutputType(InstanceSnapshotOutput{})
}