generated from pulumi/pulumi-component-provider-go-boilerplate
/
etcdctl.go
312 lines (259 loc) · 11 KB
/
etcdctl.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package tools
import (
"context"
"reflect"
"errors"
pulumiCommand "github.com/pulumi/pulumi-command/sdk/go/command/remote"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/unstoppablemango/pulumi-kubernetes-the-hard-way/sdk/go/kubernetes-the-hard-way/internal"
)
// Abstraction over the `etcdctl` utility on a remote system.
type Etcdctl struct {
pulumi.ResourceState
// Path to the binary on the remote system. If omitted, the tool is assumed to be on $PATH
BinaryPath pulumi.StringOutput `pulumi:"binaryPath"`
// The underlying command
Command pulumiCommand.CommandOutput `pulumi:"command"`
// Connection details for the remote system
Connection pulumiCommand.ConnectionOutput `pulumi:"connection"`
// The command to run on create.
Create pulumi.AnyOutput `pulumi:"create"`
// The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
// and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
// Command resource from previous create or update steps.
Delete pulumi.AnyOutput `pulumi:"delete"`
// Environment variables
Environment pulumi.StringMapOutput `pulumi:"environment"`
// TODO
Stderr pulumi.StringOutput `pulumi:"stderr"`
// TODO
Stdin pulumi.StringPtrOutput `pulumi:"stdin"`
// TODO
Stdout pulumi.StringOutput `pulumi:"stdout"`
// TODO
Triggers pulumi.ArrayOutput `pulumi:"triggers"`
// The command to run on update, if empty, create will
// run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
// are set to the stdout and stderr properties of the Command resource from previous
// create or update steps.
Update pulumi.AnyOutput `pulumi:"update"`
}
// NewEtcdctl registers a new resource with the given unique name, arguments, and options.
func NewEtcdctl(ctx *pulumi.Context,
name string, args *EtcdctlArgs, opts ...pulumi.ResourceOption) (*Etcdctl, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Connection == nil {
return nil, errors.New("invalid value for required argument 'Connection'")
}
args.Connection = args.Connection.ToConnectionOutput().ApplyT(func(v pulumiCommand.Connection) pulumiCommand.Connection { return *v.Defaults() }).(pulumiCommand.ConnectionOutput)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Etcdctl
err := ctx.RegisterRemoteComponentResource("kubernetes-the-hard-way:tools:Etcdctl", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type etcdctlArgs struct {
// Path to the binary on the remote system. If omitted, the tool is assumed to be on $PATH
BinaryPath *string `pulumi:"binaryPath"`
// Connection details for the remote system
Connection pulumiCommand.Connection `pulumi:"connection"`
// The command to run on create.
Create interface{} `pulumi:"create"`
// The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
// and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
// Command resource from previous create or update steps.
Delete interface{} `pulumi:"delete"`
// Environment variables
Environment map[string]string `pulumi:"environment"`
// TODO
Stdin *string `pulumi:"stdin"`
// TODO
Triggers []interface{} `pulumi:"triggers"`
// The command to run on update, if empty, create will
// run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
// are set to the stdout and stderr properties of the Command resource from previous
// create or update steps.
Update interface{} `pulumi:"update"`
}
// The set of arguments for constructing a Etcdctl resource.
type EtcdctlArgs struct {
// Path to the binary on the remote system. If omitted, the tool is assumed to be on $PATH
BinaryPath pulumi.StringPtrInput
// Connection details for the remote system
Connection pulumiCommand.ConnectionInput
// The command to run on create.
Create interface{}
// The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
// and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
// Command resource from previous create or update steps.
Delete interface{}
// Environment variables
Environment pulumi.StringMapInput
// TODO
Stdin pulumi.StringPtrInput
// TODO
Triggers pulumi.ArrayInput
// The command to run on update, if empty, create will
// run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
// are set to the stdout and stderr properties of the Command resource from previous
// create or update steps.
Update interface{}
}
func (EtcdctlArgs) ElementType() reflect.Type {
return reflect.TypeOf((*etcdctlArgs)(nil)).Elem()
}
type EtcdctlInput interface {
pulumi.Input
ToEtcdctlOutput() EtcdctlOutput
ToEtcdctlOutputWithContext(ctx context.Context) EtcdctlOutput
}
func (*Etcdctl) ElementType() reflect.Type {
return reflect.TypeOf((**Etcdctl)(nil)).Elem()
}
func (i *Etcdctl) ToEtcdctlOutput() EtcdctlOutput {
return i.ToEtcdctlOutputWithContext(context.Background())
}
func (i *Etcdctl) ToEtcdctlOutputWithContext(ctx context.Context) EtcdctlOutput {
return pulumi.ToOutputWithContext(ctx, i).(EtcdctlOutput)
}
// EtcdctlArrayInput is an input type that accepts EtcdctlArray and EtcdctlArrayOutput values.
// You can construct a concrete instance of `EtcdctlArrayInput` via:
//
// EtcdctlArray{ EtcdctlArgs{...} }
type EtcdctlArrayInput interface {
pulumi.Input
ToEtcdctlArrayOutput() EtcdctlArrayOutput
ToEtcdctlArrayOutputWithContext(context.Context) EtcdctlArrayOutput
}
type EtcdctlArray []EtcdctlInput
func (EtcdctlArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Etcdctl)(nil)).Elem()
}
func (i EtcdctlArray) ToEtcdctlArrayOutput() EtcdctlArrayOutput {
return i.ToEtcdctlArrayOutputWithContext(context.Background())
}
func (i EtcdctlArray) ToEtcdctlArrayOutputWithContext(ctx context.Context) EtcdctlArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EtcdctlArrayOutput)
}
// EtcdctlMapInput is an input type that accepts EtcdctlMap and EtcdctlMapOutput values.
// You can construct a concrete instance of `EtcdctlMapInput` via:
//
// EtcdctlMap{ "key": EtcdctlArgs{...} }
type EtcdctlMapInput interface {
pulumi.Input
ToEtcdctlMapOutput() EtcdctlMapOutput
ToEtcdctlMapOutputWithContext(context.Context) EtcdctlMapOutput
}
type EtcdctlMap map[string]EtcdctlInput
func (EtcdctlMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Etcdctl)(nil)).Elem()
}
func (i EtcdctlMap) ToEtcdctlMapOutput() EtcdctlMapOutput {
return i.ToEtcdctlMapOutputWithContext(context.Background())
}
func (i EtcdctlMap) ToEtcdctlMapOutputWithContext(ctx context.Context) EtcdctlMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EtcdctlMapOutput)
}
type EtcdctlOutput struct{ *pulumi.OutputState }
func (EtcdctlOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Etcdctl)(nil)).Elem()
}
func (o EtcdctlOutput) ToEtcdctlOutput() EtcdctlOutput {
return o
}
func (o EtcdctlOutput) ToEtcdctlOutputWithContext(ctx context.Context) EtcdctlOutput {
return o
}
// Path to the binary on the remote system. If omitted, the tool is assumed to be on $PATH
func (o EtcdctlOutput) BinaryPath() pulumi.StringOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.StringOutput { return v.BinaryPath }).(pulumi.StringOutput)
}
// The underlying command
func (o EtcdctlOutput) Command() pulumiCommand.CommandOutput {
return o.ApplyT(func(v *Etcdctl) pulumiCommand.CommandOutput { return v.Command }).(pulumiCommand.CommandOutput)
}
// Connection details for the remote system
func (o EtcdctlOutput) Connection() pulumiCommand.ConnectionOutput {
return o.ApplyT(func(v *Etcdctl) pulumiCommand.ConnectionOutput { return v.Connection }).(pulumiCommand.ConnectionOutput)
}
// The command to run on create.
func (o EtcdctlOutput) Create() pulumi.AnyOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.AnyOutput { return v.Create }).(pulumi.AnyOutput)
}
// The command to run on delete. The environment variables PULUMI_COMMAND_STDOUT
// and PULUMI_COMMAND_STDERR are set to the stdout and stderr properties of the
// Command resource from previous create or update steps.
func (o EtcdctlOutput) Delete() pulumi.AnyOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.AnyOutput { return v.Delete }).(pulumi.AnyOutput)
}
// Environment variables
func (o EtcdctlOutput) Environment() pulumi.StringMapOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.StringMapOutput { return v.Environment }).(pulumi.StringMapOutput)
}
// TODO
func (o EtcdctlOutput) Stderr() pulumi.StringOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput)
}
// TODO
func (o EtcdctlOutput) Stdin() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.StringPtrOutput { return v.Stdin }).(pulumi.StringPtrOutput)
}
// TODO
func (o EtcdctlOutput) Stdout() pulumi.StringOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput)
}
// TODO
func (o EtcdctlOutput) Triggers() pulumi.ArrayOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.ArrayOutput { return v.Triggers }).(pulumi.ArrayOutput)
}
// The command to run on update, if empty, create will
// run again. The environment variables PULUMI_COMMAND_STDOUT and PULUMI_COMMAND_STDERR
// are set to the stdout and stderr properties of the Command resource from previous
// create or update steps.
func (o EtcdctlOutput) Update() pulumi.AnyOutput {
return o.ApplyT(func(v *Etcdctl) pulumi.AnyOutput { return v.Update }).(pulumi.AnyOutput)
}
type EtcdctlArrayOutput struct{ *pulumi.OutputState }
func (EtcdctlArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Etcdctl)(nil)).Elem()
}
func (o EtcdctlArrayOutput) ToEtcdctlArrayOutput() EtcdctlArrayOutput {
return o
}
func (o EtcdctlArrayOutput) ToEtcdctlArrayOutputWithContext(ctx context.Context) EtcdctlArrayOutput {
return o
}
func (o EtcdctlArrayOutput) Index(i pulumi.IntInput) EtcdctlOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Etcdctl {
return vs[0].([]*Etcdctl)[vs[1].(int)]
}).(EtcdctlOutput)
}
type EtcdctlMapOutput struct{ *pulumi.OutputState }
func (EtcdctlMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Etcdctl)(nil)).Elem()
}
func (o EtcdctlMapOutput) ToEtcdctlMapOutput() EtcdctlMapOutput {
return o
}
func (o EtcdctlMapOutput) ToEtcdctlMapOutputWithContext(ctx context.Context) EtcdctlMapOutput {
return o
}
func (o EtcdctlMapOutput) MapIndex(k pulumi.StringInput) EtcdctlOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Etcdctl {
return vs[0].(map[string]*Etcdctl)[vs[1].(string)]
}).(EtcdctlOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EtcdctlInput)(nil)).Elem(), &Etcdctl{})
pulumi.RegisterInputType(reflect.TypeOf((*EtcdctlArrayInput)(nil)).Elem(), EtcdctlArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EtcdctlMapInput)(nil)).Elem(), EtcdctlMap{})
pulumi.RegisterOutputType(EtcdctlOutput{})
pulumi.RegisterOutputType(EtcdctlArrayOutput{})
pulumi.RegisterOutputType(EtcdctlMapOutput{})
}