generated from pulumi/pulumi-tf-provider-boilerplate
/
appV2.go
528 lines (464 loc) · 18.9 KB
/
appV2.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
526
527
528
// 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 rancher2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Rancher App v2 resource. This can be used to manage helm charts for Rancher v2 environments and retrieve their information. App v2 resource is available at Rancher v2.5.x and above.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "os"
//
// "github.com/pulumi/pulumi-rancher2/sdk/v4/go/rancher2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func readFileOrPanic(path string) pulumi.StringPtrInput {
// data, err := os.ReadFile(path)
// if err != nil {
// panic(err.Error())
// }
// return pulumi.String(string(data))
// }
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rancher2.NewAppV2(ctx, "foo", &rancher2.AppV2Args{
// ClusterId: pulumi.String("<CLUSTER_ID>"),
// Namespace: pulumi.String("cattle-monitoring-system"),
// RepoName: pulumi.String("rancher-charts"),
// ChartName: pulumi.String("rancher-monitoring"),
// ChartVersion: pulumi.String("9.4.200"),
// Values: readFileOrPanic("values.yaml"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// V2 apps can be imported using the Rancher cluster ID and App V2 name, which is composed of `<namespace>/<application_name>`.
//
// ```sh
//
// $ pulumi import rancher2:index/appV2:AppV2 foo <CLUSTER_ID>.<APP_V2_NAME>
//
// ```
type AppV2 struct {
pulumi.CustomResourceState
// Annotations for the app v2 (map)
Annotations pulumi.MapOutput `pulumi:"annotations"`
// The app v2 chart name (string)
ChartName pulumi.StringOutput `pulumi:"chartName"`
// The app v2 chart version (string)
ChartVersion pulumi.StringOutput `pulumi:"chartVersion"`
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
CleanupOnFail pulumi.BoolPtrOutput `pulumi:"cleanupOnFail"`
// The cluster id of the app (string)
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// (Computed) The cluster name of the app (string)
ClusterName pulumi.StringOutput `pulumi:"clusterName"`
// Values YAML file including computed values. This field prevents incorrect discrepancies from showing in the terraform
// plan output when files change but values stay the same, due to additional computed values included by the provider
// itself.
DeploymentValues pulumi.StringOutput `pulumi:"deploymentValues"`
// Disable app v2 chart hooks. Default: `false` (bool)
DisableHooks pulumi.BoolPtrOutput `pulumi:"disableHooks"`
// Disable app V2 Open API Validation. Default: `false` (bool)
DisableOpenApiValidation pulumi.BoolPtrOutput `pulumi:"disableOpenApiValidation"`
// Force app V2 chart upgrade. Default: `false` (bool)
ForceUpgrade pulumi.BoolPtrOutput `pulumi:"forceUpgrade"`
// Labels for the app v2 (map)
Labels pulumi.MapOutput `pulumi:"labels"`
// The name of the app v2 (string)
Name pulumi.StringOutput `pulumi:"name"`
// The namespace of the app v2 (string)
Namespace pulumi.StringOutput `pulumi:"namespace"`
// Deploy the app v2 within project ID (string)
ProjectId pulumi.StringPtrOutput `pulumi:"projectId"`
// Repo name (string)
RepoName pulumi.StringOutput `pulumi:"repoName"`
// (Computed) The system default registry of the app (string)
SystemDefaultRegistry pulumi.StringOutput `pulumi:"systemDefaultRegistry"`
// The app v2 values yaml. Yaml format is required (string)
Values pulumi.StringPtrOutput `pulumi:"values"`
// Wait until app is deployed. Default: `true` (bool)
Wait pulumi.BoolPtrOutput `pulumi:"wait"`
}
// NewAppV2 registers a new resource with the given unique name, arguments, and options.
func NewAppV2(ctx *pulumi.Context,
name string, args *AppV2Args, opts ...pulumi.ResourceOption) (*AppV2, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ChartName == nil {
return nil, errors.New("invalid value for required argument 'ChartName'")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.Namespace == nil {
return nil, errors.New("invalid value for required argument 'Namespace'")
}
if args.RepoName == nil {
return nil, errors.New("invalid value for required argument 'RepoName'")
}
var resource AppV2
err := ctx.RegisterResource("rancher2:index/appV2:AppV2", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppV2 gets an existing AppV2 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 GetAppV2(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppV2State, opts ...pulumi.ResourceOption) (*AppV2, error) {
var resource AppV2
err := ctx.ReadResource("rancher2:index/appV2:AppV2", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppV2 resources.
type appV2State struct {
// Annotations for the app v2 (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// The app v2 chart name (string)
ChartName *string `pulumi:"chartName"`
// The app v2 chart version (string)
ChartVersion *string `pulumi:"chartVersion"`
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
CleanupOnFail *bool `pulumi:"cleanupOnFail"`
// The cluster id of the app (string)
ClusterId *string `pulumi:"clusterId"`
// (Computed) The cluster name of the app (string)
ClusterName *string `pulumi:"clusterName"`
// Values YAML file including computed values. This field prevents incorrect discrepancies from showing in the terraform
// plan output when files change but values stay the same, due to additional computed values included by the provider
// itself.
DeploymentValues *string `pulumi:"deploymentValues"`
// Disable app v2 chart hooks. Default: `false` (bool)
DisableHooks *bool `pulumi:"disableHooks"`
// Disable app V2 Open API Validation. Default: `false` (bool)
DisableOpenApiValidation *bool `pulumi:"disableOpenApiValidation"`
// Force app V2 chart upgrade. Default: `false` (bool)
ForceUpgrade *bool `pulumi:"forceUpgrade"`
// Labels for the app v2 (map)
Labels map[string]interface{} `pulumi:"labels"`
// The name of the app v2 (string)
Name *string `pulumi:"name"`
// The namespace of the app v2 (string)
Namespace *string `pulumi:"namespace"`
// Deploy the app v2 within project ID (string)
ProjectId *string `pulumi:"projectId"`
// Repo name (string)
RepoName *string `pulumi:"repoName"`
// (Computed) The system default registry of the app (string)
SystemDefaultRegistry *string `pulumi:"systemDefaultRegistry"`
// The app v2 values yaml. Yaml format is required (string)
Values *string `pulumi:"values"`
// Wait until app is deployed. Default: `true` (bool)
Wait *bool `pulumi:"wait"`
}
type AppV2State struct {
// Annotations for the app v2 (map)
Annotations pulumi.MapInput
// The app v2 chart name (string)
ChartName pulumi.StringPtrInput
// The app v2 chart version (string)
ChartVersion pulumi.StringPtrInput
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
CleanupOnFail pulumi.BoolPtrInput
// The cluster id of the app (string)
ClusterId pulumi.StringPtrInput
// (Computed) The cluster name of the app (string)
ClusterName pulumi.StringPtrInput
// Values YAML file including computed values. This field prevents incorrect discrepancies from showing in the terraform
// plan output when files change but values stay the same, due to additional computed values included by the provider
// itself.
DeploymentValues pulumi.StringPtrInput
// Disable app v2 chart hooks. Default: `false` (bool)
DisableHooks pulumi.BoolPtrInput
// Disable app V2 Open API Validation. Default: `false` (bool)
DisableOpenApiValidation pulumi.BoolPtrInput
// Force app V2 chart upgrade. Default: `false` (bool)
ForceUpgrade pulumi.BoolPtrInput
// Labels for the app v2 (map)
Labels pulumi.MapInput
// The name of the app v2 (string)
Name pulumi.StringPtrInput
// The namespace of the app v2 (string)
Namespace pulumi.StringPtrInput
// Deploy the app v2 within project ID (string)
ProjectId pulumi.StringPtrInput
// Repo name (string)
RepoName pulumi.StringPtrInput
// (Computed) The system default registry of the app (string)
SystemDefaultRegistry pulumi.StringPtrInput
// The app v2 values yaml. Yaml format is required (string)
Values pulumi.StringPtrInput
// Wait until app is deployed. Default: `true` (bool)
Wait pulumi.BoolPtrInput
}
func (AppV2State) ElementType() reflect.Type {
return reflect.TypeOf((*appV2State)(nil)).Elem()
}
type appV2Args struct {
// Annotations for the app v2 (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// The app v2 chart name (string)
ChartName string `pulumi:"chartName"`
// The app v2 chart version (string)
ChartVersion *string `pulumi:"chartVersion"`
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
CleanupOnFail *bool `pulumi:"cleanupOnFail"`
// The cluster id of the app (string)
ClusterId string `pulumi:"clusterId"`
// Disable app v2 chart hooks. Default: `false` (bool)
DisableHooks *bool `pulumi:"disableHooks"`
// Disable app V2 Open API Validation. Default: `false` (bool)
DisableOpenApiValidation *bool `pulumi:"disableOpenApiValidation"`
// Force app V2 chart upgrade. Default: `false` (bool)
ForceUpgrade *bool `pulumi:"forceUpgrade"`
// Labels for the app v2 (map)
Labels map[string]interface{} `pulumi:"labels"`
// The name of the app v2 (string)
Name *string `pulumi:"name"`
// The namespace of the app v2 (string)
Namespace string `pulumi:"namespace"`
// Deploy the app v2 within project ID (string)
ProjectId *string `pulumi:"projectId"`
// Repo name (string)
RepoName string `pulumi:"repoName"`
// The app v2 values yaml. Yaml format is required (string)
Values *string `pulumi:"values"`
// Wait until app is deployed. Default: `true` (bool)
Wait *bool `pulumi:"wait"`
}
// The set of arguments for constructing a AppV2 resource.
type AppV2Args struct {
// Annotations for the app v2 (map)
Annotations pulumi.MapInput
// The app v2 chart name (string)
ChartName pulumi.StringInput
// The app v2 chart version (string)
ChartVersion pulumi.StringPtrInput
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
CleanupOnFail pulumi.BoolPtrInput
// The cluster id of the app (string)
ClusterId pulumi.StringInput
// Disable app v2 chart hooks. Default: `false` (bool)
DisableHooks pulumi.BoolPtrInput
// Disable app V2 Open API Validation. Default: `false` (bool)
DisableOpenApiValidation pulumi.BoolPtrInput
// Force app V2 chart upgrade. Default: `false` (bool)
ForceUpgrade pulumi.BoolPtrInput
// Labels for the app v2 (map)
Labels pulumi.MapInput
// The name of the app v2 (string)
Name pulumi.StringPtrInput
// The namespace of the app v2 (string)
Namespace pulumi.StringInput
// Deploy the app v2 within project ID (string)
ProjectId pulumi.StringPtrInput
// Repo name (string)
RepoName pulumi.StringInput
// The app v2 values yaml. Yaml format is required (string)
Values pulumi.StringPtrInput
// Wait until app is deployed. Default: `true` (bool)
Wait pulumi.BoolPtrInput
}
func (AppV2Args) ElementType() reflect.Type {
return reflect.TypeOf((*appV2Args)(nil)).Elem()
}
type AppV2Input interface {
pulumi.Input
ToAppV2Output() AppV2Output
ToAppV2OutputWithContext(ctx context.Context) AppV2Output
}
func (*AppV2) ElementType() reflect.Type {
return reflect.TypeOf((**AppV2)(nil)).Elem()
}
func (i *AppV2) ToAppV2Output() AppV2Output {
return i.ToAppV2OutputWithContext(context.Background())
}
func (i *AppV2) ToAppV2OutputWithContext(ctx context.Context) AppV2Output {
return pulumi.ToOutputWithContext(ctx, i).(AppV2Output)
}
// AppV2ArrayInput is an input type that accepts AppV2Array and AppV2ArrayOutput values.
// You can construct a concrete instance of `AppV2ArrayInput` via:
//
// AppV2Array{ AppV2Args{...} }
type AppV2ArrayInput interface {
pulumi.Input
ToAppV2ArrayOutput() AppV2ArrayOutput
ToAppV2ArrayOutputWithContext(context.Context) AppV2ArrayOutput
}
type AppV2Array []AppV2Input
func (AppV2Array) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppV2)(nil)).Elem()
}
func (i AppV2Array) ToAppV2ArrayOutput() AppV2ArrayOutput {
return i.ToAppV2ArrayOutputWithContext(context.Background())
}
func (i AppV2Array) ToAppV2ArrayOutputWithContext(ctx context.Context) AppV2ArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppV2ArrayOutput)
}
// AppV2MapInput is an input type that accepts AppV2Map and AppV2MapOutput values.
// You can construct a concrete instance of `AppV2MapInput` via:
//
// AppV2Map{ "key": AppV2Args{...} }
type AppV2MapInput interface {
pulumi.Input
ToAppV2MapOutput() AppV2MapOutput
ToAppV2MapOutputWithContext(context.Context) AppV2MapOutput
}
type AppV2Map map[string]AppV2Input
func (AppV2Map) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppV2)(nil)).Elem()
}
func (i AppV2Map) ToAppV2MapOutput() AppV2MapOutput {
return i.ToAppV2MapOutputWithContext(context.Background())
}
func (i AppV2Map) ToAppV2MapOutputWithContext(ctx context.Context) AppV2MapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppV2MapOutput)
}
type AppV2Output struct{ *pulumi.OutputState }
func (AppV2Output) ElementType() reflect.Type {
return reflect.TypeOf((**AppV2)(nil)).Elem()
}
func (o AppV2Output) ToAppV2Output() AppV2Output {
return o
}
func (o AppV2Output) ToAppV2OutputWithContext(ctx context.Context) AppV2Output {
return o
}
// Annotations for the app v2 (map)
func (o AppV2Output) Annotations() pulumi.MapOutput {
return o.ApplyT(func(v *AppV2) pulumi.MapOutput { return v.Annotations }).(pulumi.MapOutput)
}
// The app v2 chart name (string)
func (o AppV2Output) ChartName() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.ChartName }).(pulumi.StringOutput)
}
// The app v2 chart version (string)
func (o AppV2Output) ChartVersion() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.ChartVersion }).(pulumi.StringOutput)
}
// Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
func (o AppV2Output) CleanupOnFail() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.BoolPtrOutput { return v.CleanupOnFail }).(pulumi.BoolPtrOutput)
}
// The cluster id of the app (string)
func (o AppV2Output) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// (Computed) The cluster name of the app (string)
func (o AppV2Output) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.ClusterName }).(pulumi.StringOutput)
}
// Values YAML file including computed values. This field prevents incorrect discrepancies from showing in the terraform
// plan output when files change but values stay the same, due to additional computed values included by the provider
// itself.
func (o AppV2Output) DeploymentValues() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.DeploymentValues }).(pulumi.StringOutput)
}
// Disable app v2 chart hooks. Default: `false` (bool)
func (o AppV2Output) DisableHooks() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.BoolPtrOutput { return v.DisableHooks }).(pulumi.BoolPtrOutput)
}
// Disable app V2 Open API Validation. Default: `false` (bool)
func (o AppV2Output) DisableOpenApiValidation() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.BoolPtrOutput { return v.DisableOpenApiValidation }).(pulumi.BoolPtrOutput)
}
// Force app V2 chart upgrade. Default: `false` (bool)
func (o AppV2Output) ForceUpgrade() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.BoolPtrOutput { return v.ForceUpgrade }).(pulumi.BoolPtrOutput)
}
// Labels for the app v2 (map)
func (o AppV2Output) Labels() pulumi.MapOutput {
return o.ApplyT(func(v *AppV2) pulumi.MapOutput { return v.Labels }).(pulumi.MapOutput)
}
// The name of the app v2 (string)
func (o AppV2Output) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The namespace of the app v2 (string)
func (o AppV2Output) Namespace() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.Namespace }).(pulumi.StringOutput)
}
// Deploy the app v2 within project ID (string)
func (o AppV2Output) ProjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringPtrOutput { return v.ProjectId }).(pulumi.StringPtrOutput)
}
// Repo name (string)
func (o AppV2Output) RepoName() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.RepoName }).(pulumi.StringOutput)
}
// (Computed) The system default registry of the app (string)
func (o AppV2Output) SystemDefaultRegistry() pulumi.StringOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringOutput { return v.SystemDefaultRegistry }).(pulumi.StringOutput)
}
// The app v2 values yaml. Yaml format is required (string)
func (o AppV2Output) Values() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.StringPtrOutput { return v.Values }).(pulumi.StringPtrOutput)
}
// Wait until app is deployed. Default: `true` (bool)
func (o AppV2Output) Wait() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AppV2) pulumi.BoolPtrOutput { return v.Wait }).(pulumi.BoolPtrOutput)
}
type AppV2ArrayOutput struct{ *pulumi.OutputState }
func (AppV2ArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppV2)(nil)).Elem()
}
func (o AppV2ArrayOutput) ToAppV2ArrayOutput() AppV2ArrayOutput {
return o
}
func (o AppV2ArrayOutput) ToAppV2ArrayOutputWithContext(ctx context.Context) AppV2ArrayOutput {
return o
}
func (o AppV2ArrayOutput) Index(i pulumi.IntInput) AppV2Output {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppV2 {
return vs[0].([]*AppV2)[vs[1].(int)]
}).(AppV2Output)
}
type AppV2MapOutput struct{ *pulumi.OutputState }
func (AppV2MapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppV2)(nil)).Elem()
}
func (o AppV2MapOutput) ToAppV2MapOutput() AppV2MapOutput {
return o
}
func (o AppV2MapOutput) ToAppV2MapOutputWithContext(ctx context.Context) AppV2MapOutput {
return o
}
func (o AppV2MapOutput) MapIndex(k pulumi.StringInput) AppV2Output {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppV2 {
return vs[0].(map[string]*AppV2)[vs[1].(string)]
}).(AppV2Output)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppV2Input)(nil)).Elem(), &AppV2{})
pulumi.RegisterInputType(reflect.TypeOf((*AppV2ArrayInput)(nil)).Elem(), AppV2Array{})
pulumi.RegisterInputType(reflect.TypeOf((*AppV2MapInput)(nil)).Elem(), AppV2Map{})
pulumi.RegisterOutputType(AppV2Output{})
pulumi.RegisterOutputType(AppV2ArrayOutput{})
pulumi.RegisterOutputType(AppV2MapOutput{})
}