generated from pulumi/pulumi-tf-provider-boilerplate
/
function.go
780 lines (695 loc) · 34.9 KB
/
function.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
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
// 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 scf
import (
"context"
"reflect"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Function struct {
pulumi.CustomResourceState
// List of CFS configurations.
CfsConfigs FunctionCfsConfigArrayOutput `pulumi:"cfsConfigs"`
// cls logset id of the SCF function.
ClsLogsetId pulumi.StringOutput `pulumi:"clsLogsetId"`
// cls topic id of the SCF function.
ClsTopicId pulumi.StringOutput `pulumi:"clsTopicId"`
// SCF function code error message.
CodeError pulumi.StringOutput `pulumi:"codeError"`
// SCF function code is correct.
CodeResult pulumi.StringOutput `pulumi:"codeResult"`
// SCF function code size, unit is M.
CodeSize pulumi.IntOutput `pulumi:"codeSize"`
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
CosBucketName pulumi.StringPtrOutput `pulumi:"cosBucketName"`
// Cos bucket region of the SCF function, conflict with `zip_file`.
CosBucketRegion pulumi.StringPtrOutput `pulumi:"cosBucketRegion"`
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
CosObjectName pulumi.StringPtrOutput `pulumi:"cosObjectName"`
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether EIP is a fixed IP.
EipFixed pulumi.BoolOutput `pulumi:"eipFixed"`
// SCF function EIP list.
Eips pulumi.StringArrayOutput `pulumi:"eips"`
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
EnableEipConfig pulumi.BoolPtrOutput `pulumi:"enableEipConfig"`
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
EnablePublicNet pulumi.BoolPtrOutput `pulumi:"enablePublicNet"`
// Environment of the SCF function.
Environment pulumi.MapOutput `pulumi:"environment"`
// SCF function code error code.
ErrNo pulumi.IntOutput `pulumi:"errNo"`
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
FuncType pulumi.StringOutput `pulumi:"funcType"`
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
Handler pulumi.StringPtrOutput `pulumi:"handler"`
// SCF function domain name.
Host pulumi.StringOutput `pulumi:"host"`
// Image of the SCF function, conflict with ``.
ImageConfigs FunctionImageConfigArrayOutput `pulumi:"imageConfigs"`
// Whether to automatically install dependencies.
InstallDependency pulumi.BoolOutput `pulumi:"installDependency"`
// Enable L5 for SCF function, default is `false`.
L5Enable pulumi.BoolPtrOutput `pulumi:"l5Enable"`
// The list of association layers.
Layers FunctionLayerArrayOutput `pulumi:"layers"`
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
MemSize pulumi.IntPtrOutput `pulumi:"memSize"`
// SCF function last modified time.
ModifyTime pulumi.StringOutput `pulumi:"modifyTime"`
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
Name pulumi.StringOutput `pulumi:"name"`
// Namespace of the SCF function, default is `default`.
Namespace pulumi.StringPtrOutput `pulumi:"namespace"`
// Role of the SCF function.
Role pulumi.StringPtrOutput `pulumi:"role"`
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
Runtime pulumi.StringPtrOutput `pulumi:"runtime"`
// SCF function status.
Status pulumi.StringOutput `pulumi:"status"`
// SCF status description.
StatusDesc pulumi.StringOutput `pulumi:"statusDesc"`
// Subnet ID of the SCF function.
SubnetId pulumi.StringPtrOutput `pulumi:"subnetId"`
// Tags of the SCF function.
Tags pulumi.MapOutput `pulumi:"tags"`
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
Timeout pulumi.IntPtrOutput `pulumi:"timeout"`
// SCF trigger details list. Each element contains the following attributes:
TriggerInfos FunctionTriggerInfoArrayOutput `pulumi:"triggerInfos"`
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
Triggers FunctionTriggerArrayOutput `pulumi:"triggers"`
// SCF function vip.
Vip pulumi.StringOutput `pulumi:"vip"`
// VPC ID of the SCF function.
VpcId pulumi.StringPtrOutput `pulumi:"vpcId"`
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
ZipFile pulumi.StringPtrOutput `pulumi:"zipFile"`
}
// NewFunction registers a new resource with the given unique name, arguments, and options.
func NewFunction(ctx *pulumi.Context,
name string, args *FunctionArgs, opts ...pulumi.ResourceOption) (*Function, error) {
if args == nil {
args = &FunctionArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Function
err := ctx.RegisterResource("tencentcloud:Scf/function:Function", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFunction gets an existing Function 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 GetFunction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FunctionState, opts ...pulumi.ResourceOption) (*Function, error) {
var resource Function
err := ctx.ReadResource("tencentcloud:Scf/function:Function", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Function resources.
type functionState struct {
// List of CFS configurations.
CfsConfigs []FunctionCfsConfig `pulumi:"cfsConfigs"`
// cls logset id of the SCF function.
ClsLogsetId *string `pulumi:"clsLogsetId"`
// cls topic id of the SCF function.
ClsTopicId *string `pulumi:"clsTopicId"`
// SCF function code error message.
CodeError *string `pulumi:"codeError"`
// SCF function code is correct.
CodeResult *string `pulumi:"codeResult"`
// SCF function code size, unit is M.
CodeSize *int `pulumi:"codeSize"`
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
CosBucketName *string `pulumi:"cosBucketName"`
// Cos bucket region of the SCF function, conflict with `zip_file`.
CosBucketRegion *string `pulumi:"cosBucketRegion"`
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
CosObjectName *string `pulumi:"cosObjectName"`
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
Description *string `pulumi:"description"`
// Whether EIP is a fixed IP.
EipFixed *bool `pulumi:"eipFixed"`
// SCF function EIP list.
Eips []string `pulumi:"eips"`
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
EnableEipConfig *bool `pulumi:"enableEipConfig"`
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
EnablePublicNet *bool `pulumi:"enablePublicNet"`
// Environment of the SCF function.
Environment map[string]interface{} `pulumi:"environment"`
// SCF function code error code.
ErrNo *int `pulumi:"errNo"`
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
FuncType *string `pulumi:"funcType"`
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
Handler *string `pulumi:"handler"`
// SCF function domain name.
Host *string `pulumi:"host"`
// Image of the SCF function, conflict with ``.
ImageConfigs []FunctionImageConfig `pulumi:"imageConfigs"`
// Whether to automatically install dependencies.
InstallDependency *bool `pulumi:"installDependency"`
// Enable L5 for SCF function, default is `false`.
L5Enable *bool `pulumi:"l5Enable"`
// The list of association layers.
Layers []FunctionLayer `pulumi:"layers"`
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
MemSize *int `pulumi:"memSize"`
// SCF function last modified time.
ModifyTime *string `pulumi:"modifyTime"`
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
Name *string `pulumi:"name"`
// Namespace of the SCF function, default is `default`.
Namespace *string `pulumi:"namespace"`
// Role of the SCF function.
Role *string `pulumi:"role"`
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
Runtime *string `pulumi:"runtime"`
// SCF function status.
Status *string `pulumi:"status"`
// SCF status description.
StatusDesc *string `pulumi:"statusDesc"`
// Subnet ID of the SCF function.
SubnetId *string `pulumi:"subnetId"`
// Tags of the SCF function.
Tags map[string]interface{} `pulumi:"tags"`
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
Timeout *int `pulumi:"timeout"`
// SCF trigger details list. Each element contains the following attributes:
TriggerInfos []FunctionTriggerInfo `pulumi:"triggerInfos"`
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
Triggers []FunctionTrigger `pulumi:"triggers"`
// SCF function vip.
Vip *string `pulumi:"vip"`
// VPC ID of the SCF function.
VpcId *string `pulumi:"vpcId"`
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
ZipFile *string `pulumi:"zipFile"`
}
type FunctionState struct {
// List of CFS configurations.
CfsConfigs FunctionCfsConfigArrayInput
// cls logset id of the SCF function.
ClsLogsetId pulumi.StringPtrInput
// cls topic id of the SCF function.
ClsTopicId pulumi.StringPtrInput
// SCF function code error message.
CodeError pulumi.StringPtrInput
// SCF function code is correct.
CodeResult pulumi.StringPtrInput
// SCF function code size, unit is M.
CodeSize pulumi.IntPtrInput
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
CosBucketName pulumi.StringPtrInput
// Cos bucket region of the SCF function, conflict with `zip_file`.
CosBucketRegion pulumi.StringPtrInput
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
CosObjectName pulumi.StringPtrInput
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
Description pulumi.StringPtrInput
// Whether EIP is a fixed IP.
EipFixed pulumi.BoolPtrInput
// SCF function EIP list.
Eips pulumi.StringArrayInput
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
EnableEipConfig pulumi.BoolPtrInput
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
EnablePublicNet pulumi.BoolPtrInput
// Environment of the SCF function.
Environment pulumi.MapInput
// SCF function code error code.
ErrNo pulumi.IntPtrInput
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
FuncType pulumi.StringPtrInput
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
Handler pulumi.StringPtrInput
// SCF function domain name.
Host pulumi.StringPtrInput
// Image of the SCF function, conflict with ``.
ImageConfigs FunctionImageConfigArrayInput
// Whether to automatically install dependencies.
InstallDependency pulumi.BoolPtrInput
// Enable L5 for SCF function, default is `false`.
L5Enable pulumi.BoolPtrInput
// The list of association layers.
Layers FunctionLayerArrayInput
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
MemSize pulumi.IntPtrInput
// SCF function last modified time.
ModifyTime pulumi.StringPtrInput
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
Name pulumi.StringPtrInput
// Namespace of the SCF function, default is `default`.
Namespace pulumi.StringPtrInput
// Role of the SCF function.
Role pulumi.StringPtrInput
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
Runtime pulumi.StringPtrInput
// SCF function status.
Status pulumi.StringPtrInput
// SCF status description.
StatusDesc pulumi.StringPtrInput
// Subnet ID of the SCF function.
SubnetId pulumi.StringPtrInput
// Tags of the SCF function.
Tags pulumi.MapInput
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
Timeout pulumi.IntPtrInput
// SCF trigger details list. Each element contains the following attributes:
TriggerInfos FunctionTriggerInfoArrayInput
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
Triggers FunctionTriggerArrayInput
// SCF function vip.
Vip pulumi.StringPtrInput
// VPC ID of the SCF function.
VpcId pulumi.StringPtrInput
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
ZipFile pulumi.StringPtrInput
}
func (FunctionState) ElementType() reflect.Type {
return reflect.TypeOf((*functionState)(nil)).Elem()
}
type functionArgs struct {
// List of CFS configurations.
CfsConfigs []FunctionCfsConfig `pulumi:"cfsConfigs"`
// cls logset id of the SCF function.
ClsLogsetId *string `pulumi:"clsLogsetId"`
// cls topic id of the SCF function.
ClsTopicId *string `pulumi:"clsTopicId"`
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
CosBucketName *string `pulumi:"cosBucketName"`
// Cos bucket region of the SCF function, conflict with `zip_file`.
CosBucketRegion *string `pulumi:"cosBucketRegion"`
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
CosObjectName *string `pulumi:"cosObjectName"`
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
Description *string `pulumi:"description"`
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
EnableEipConfig *bool `pulumi:"enableEipConfig"`
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
EnablePublicNet *bool `pulumi:"enablePublicNet"`
// Environment of the SCF function.
Environment map[string]interface{} `pulumi:"environment"`
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
FuncType *string `pulumi:"funcType"`
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
Handler *string `pulumi:"handler"`
// Image of the SCF function, conflict with ``.
ImageConfigs []FunctionImageConfig `pulumi:"imageConfigs"`
// Enable L5 for SCF function, default is `false`.
L5Enable *bool `pulumi:"l5Enable"`
// The list of association layers.
Layers []FunctionLayer `pulumi:"layers"`
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
MemSize *int `pulumi:"memSize"`
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
Name *string `pulumi:"name"`
// Namespace of the SCF function, default is `default`.
Namespace *string `pulumi:"namespace"`
// Role of the SCF function.
Role *string `pulumi:"role"`
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
Runtime *string `pulumi:"runtime"`
// Subnet ID of the SCF function.
SubnetId *string `pulumi:"subnetId"`
// Tags of the SCF function.
Tags map[string]interface{} `pulumi:"tags"`
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
Timeout *int `pulumi:"timeout"`
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
Triggers []FunctionTrigger `pulumi:"triggers"`
// VPC ID of the SCF function.
VpcId *string `pulumi:"vpcId"`
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
ZipFile *string `pulumi:"zipFile"`
}
// The set of arguments for constructing a Function resource.
type FunctionArgs struct {
// List of CFS configurations.
CfsConfigs FunctionCfsConfigArrayInput
// cls logset id of the SCF function.
ClsLogsetId pulumi.StringPtrInput
// cls topic id of the SCF function.
ClsTopicId pulumi.StringPtrInput
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
CosBucketName pulumi.StringPtrInput
// Cos bucket region of the SCF function, conflict with `zip_file`.
CosBucketRegion pulumi.StringPtrInput
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
CosObjectName pulumi.StringPtrInput
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
Description pulumi.StringPtrInput
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
EnableEipConfig pulumi.BoolPtrInput
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
EnablePublicNet pulumi.BoolPtrInput
// Environment of the SCF function.
Environment pulumi.MapInput
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
FuncType pulumi.StringPtrInput
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
Handler pulumi.StringPtrInput
// Image of the SCF function, conflict with ``.
ImageConfigs FunctionImageConfigArrayInput
// Enable L5 for SCF function, default is `false`.
L5Enable pulumi.BoolPtrInput
// The list of association layers.
Layers FunctionLayerArrayInput
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
MemSize pulumi.IntPtrInput
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
Name pulumi.StringPtrInput
// Namespace of the SCF function, default is `default`.
Namespace pulumi.StringPtrInput
// Role of the SCF function.
Role pulumi.StringPtrInput
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
Runtime pulumi.StringPtrInput
// Subnet ID of the SCF function.
SubnetId pulumi.StringPtrInput
// Tags of the SCF function.
Tags pulumi.MapInput
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
Timeout pulumi.IntPtrInput
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
Triggers FunctionTriggerArrayInput
// VPC ID of the SCF function.
VpcId pulumi.StringPtrInput
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
ZipFile pulumi.StringPtrInput
}
func (FunctionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*functionArgs)(nil)).Elem()
}
type FunctionInput interface {
pulumi.Input
ToFunctionOutput() FunctionOutput
ToFunctionOutputWithContext(ctx context.Context) FunctionOutput
}
func (*Function) ElementType() reflect.Type {
return reflect.TypeOf((**Function)(nil)).Elem()
}
func (i *Function) ToFunctionOutput() FunctionOutput {
return i.ToFunctionOutputWithContext(context.Background())
}
func (i *Function) ToFunctionOutputWithContext(ctx context.Context) FunctionOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionOutput)
}
// FunctionArrayInput is an input type that accepts FunctionArray and FunctionArrayOutput values.
// You can construct a concrete instance of `FunctionArrayInput` via:
//
// FunctionArray{ FunctionArgs{...} }
type FunctionArrayInput interface {
pulumi.Input
ToFunctionArrayOutput() FunctionArrayOutput
ToFunctionArrayOutputWithContext(context.Context) FunctionArrayOutput
}
type FunctionArray []FunctionInput
func (FunctionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Function)(nil)).Elem()
}
func (i FunctionArray) ToFunctionArrayOutput() FunctionArrayOutput {
return i.ToFunctionArrayOutputWithContext(context.Background())
}
func (i FunctionArray) ToFunctionArrayOutputWithContext(ctx context.Context) FunctionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionArrayOutput)
}
// FunctionMapInput is an input type that accepts FunctionMap and FunctionMapOutput values.
// You can construct a concrete instance of `FunctionMapInput` via:
//
// FunctionMap{ "key": FunctionArgs{...} }
type FunctionMapInput interface {
pulumi.Input
ToFunctionMapOutput() FunctionMapOutput
ToFunctionMapOutputWithContext(context.Context) FunctionMapOutput
}
type FunctionMap map[string]FunctionInput
func (FunctionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Function)(nil)).Elem()
}
func (i FunctionMap) ToFunctionMapOutput() FunctionMapOutput {
return i.ToFunctionMapOutputWithContext(context.Background())
}
func (i FunctionMap) ToFunctionMapOutputWithContext(ctx context.Context) FunctionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionMapOutput)
}
type FunctionOutput struct{ *pulumi.OutputState }
func (FunctionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Function)(nil)).Elem()
}
func (o FunctionOutput) ToFunctionOutput() FunctionOutput {
return o
}
func (o FunctionOutput) ToFunctionOutputWithContext(ctx context.Context) FunctionOutput {
return o
}
// List of CFS configurations.
func (o FunctionOutput) CfsConfigs() FunctionCfsConfigArrayOutput {
return o.ApplyT(func(v *Function) FunctionCfsConfigArrayOutput { return v.CfsConfigs }).(FunctionCfsConfigArrayOutput)
}
// cls logset id of the SCF function.
func (o FunctionOutput) ClsLogsetId() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ClsLogsetId }).(pulumi.StringOutput)
}
// cls topic id of the SCF function.
func (o FunctionOutput) ClsTopicId() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ClsTopicId }).(pulumi.StringOutput)
}
// SCF function code error message.
func (o FunctionOutput) CodeError() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.CodeError }).(pulumi.StringOutput)
}
// SCF function code is correct.
func (o FunctionOutput) CodeResult() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.CodeResult }).(pulumi.StringOutput)
}
// SCF function code size, unit is M.
func (o FunctionOutput) CodeSize() pulumi.IntOutput {
return o.ApplyT(func(v *Function) pulumi.IntOutput { return v.CodeSize }).(pulumi.IntOutput)
}
// Cos bucket name of the SCF function, such as `cos-1234567890`, conflict with `zip_file`.
func (o FunctionOutput) CosBucketName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.CosBucketName }).(pulumi.StringPtrOutput)
}
// Cos bucket region of the SCF function, conflict with `zip_file`.
func (o FunctionOutput) CosBucketRegion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.CosBucketRegion }).(pulumi.StringPtrOutput)
}
// Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
func (o FunctionOutput) CosObjectName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.CosObjectName }).(pulumi.StringPtrOutput)
}
// Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and
// Chinese, the maximum length is 1000.
func (o FunctionOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Whether EIP is a fixed IP.
func (o FunctionOutput) EipFixed() pulumi.BoolOutput {
return o.ApplyT(func(v *Function) pulumi.BoolOutput { return v.EipFixed }).(pulumi.BoolOutput)
}
// SCF function EIP list.
func (o FunctionOutput) Eips() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Function) pulumi.StringArrayOutput { return v.Eips }).(pulumi.StringArrayOutput)
}
// Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true. Default `false`.
func (o FunctionOutput) EnableEipConfig() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Function) pulumi.BoolPtrOutput { return v.EnableEipConfig }).(pulumi.BoolPtrOutput)
}
// Indicates whether public net config enabled. Default `false`. NOTE: only `vpc_id` specified can disable public net
// config.
func (o FunctionOutput) EnablePublicNet() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Function) pulumi.BoolPtrOutput { return v.EnablePublicNet }).(pulumi.BoolPtrOutput)
}
// Environment of the SCF function.
func (o FunctionOutput) Environment() pulumi.MapOutput {
return o.ApplyT(func(v *Function) pulumi.MapOutput { return v.Environment }).(pulumi.MapOutput)
}
// SCF function code error code.
func (o FunctionOutput) ErrNo() pulumi.IntOutput {
return o.ApplyT(func(v *Function) pulumi.IntOutput { return v.ErrNo }).(pulumi.IntOutput)
}
// Function type. The default value is Event. Enter Event if you need to create a trigger function. Enter HTTP if you need
// to create an HTTP function service.
func (o FunctionOutput) FuncType() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.FuncType }).(pulumi.StringOutput)
}
// Handler of the SCF function. The format of name is `<filename>.<method_name>`, and it supports 26 English letters,
// numbers, connectors, and underscores, it should start with a letter. The last character cannot be `-` or `_`. Available
// length is 2-60.
func (o FunctionOutput) Handler() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Handler }).(pulumi.StringPtrOutput)
}
// SCF function domain name.
func (o FunctionOutput) Host() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Host }).(pulumi.StringOutput)
}
// Image of the SCF function, conflict with “.
func (o FunctionOutput) ImageConfigs() FunctionImageConfigArrayOutput {
return o.ApplyT(func(v *Function) FunctionImageConfigArrayOutput { return v.ImageConfigs }).(FunctionImageConfigArrayOutput)
}
// Whether to automatically install dependencies.
func (o FunctionOutput) InstallDependency() pulumi.BoolOutput {
return o.ApplyT(func(v *Function) pulumi.BoolOutput { return v.InstallDependency }).(pulumi.BoolOutput)
}
// Enable L5 for SCF function, default is `false`.
func (o FunctionOutput) L5Enable() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Function) pulumi.BoolPtrOutput { return v.L5Enable }).(pulumi.BoolPtrOutput)
}
// The list of association layers.
func (o FunctionOutput) Layers() FunctionLayerArrayOutput {
return o.ApplyT(func(v *Function) FunctionLayerArrayOutput { return v.Layers }).(FunctionLayerArrayOutput)
}
// Memory size of the SCF function, unit is MB. The default is `128`MB. The ladder is 128M.
func (o FunctionOutput) MemSize() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Function) pulumi.IntPtrOutput { return v.MemSize }).(pulumi.IntPtrOutput)
}
// SCF function last modified time.
func (o FunctionOutput) ModifyTime() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ModifyTime }).(pulumi.StringOutput)
}
// Name of the SCF function. Name supports 26 English letters, numbers, connectors, and underscores, it should start with a
// letter. The last character cannot be `-` or `_`. Available length is 2-60.
func (o FunctionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Namespace of the SCF function, default is `default`.
func (o FunctionOutput) Namespace() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Namespace }).(pulumi.StringPtrOutput)
}
// Role of the SCF function.
func (o FunctionOutput) Role() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Role }).(pulumi.StringPtrOutput)
}
// Runtime of the SCF function, only supports `Python2.7`, `Python3.6`, `Nodejs6.10`, `Nodejs8.9`, `Nodejs10.15`, `PHP5`,
// `PHP7`, `Golang1`, and `Java8`.
func (o FunctionOutput) Runtime() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Runtime }).(pulumi.StringPtrOutput)
}
// SCF function status.
func (o FunctionOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// SCF status description.
func (o FunctionOutput) StatusDesc() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.StatusDesc }).(pulumi.StringOutput)
}
// Subnet ID of the SCF function.
func (o FunctionOutput) SubnetId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.SubnetId }).(pulumi.StringPtrOutput)
}
// Tags of the SCF function.
func (o FunctionOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *Function) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
// Timeout of the SCF function, unit is second. Default `3`. Available value is 1-900.
func (o FunctionOutput) Timeout() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Function) pulumi.IntPtrOutput { return v.Timeout }).(pulumi.IntPtrOutput)
}
// SCF trigger details list. Each element contains the following attributes:
func (o FunctionOutput) TriggerInfos() FunctionTriggerInfoArrayOutput {
return o.ApplyT(func(v *Function) FunctionTriggerInfoArrayOutput { return v.TriggerInfos }).(FunctionTriggerInfoArrayOutput)
}
// Trigger list of the SCF function, note that if you modify the trigger list, all existing triggers will be deleted, and
// then create triggers in the new list. Each element contains the following attributes:
func (o FunctionOutput) Triggers() FunctionTriggerArrayOutput {
return o.ApplyT(func(v *Function) FunctionTriggerArrayOutput { return v.Triggers }).(FunctionTriggerArrayOutput)
}
// SCF function vip.
func (o FunctionOutput) Vip() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Vip }).(pulumi.StringOutput)
}
// VPC ID of the SCF function.
func (o FunctionOutput) VpcId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.VpcId }).(pulumi.StringPtrOutput)
}
// Zip file of the SCF function, conflict with `cos_bucket_name`, `cos_object_name`, `cos_bucket_region`.
func (o FunctionOutput) ZipFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.ZipFile }).(pulumi.StringPtrOutput)
}
type FunctionArrayOutput struct{ *pulumi.OutputState }
func (FunctionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Function)(nil)).Elem()
}
func (o FunctionArrayOutput) ToFunctionArrayOutput() FunctionArrayOutput {
return o
}
func (o FunctionArrayOutput) ToFunctionArrayOutputWithContext(ctx context.Context) FunctionArrayOutput {
return o
}
func (o FunctionArrayOutput) Index(i pulumi.IntInput) FunctionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Function {
return vs[0].([]*Function)[vs[1].(int)]
}).(FunctionOutput)
}
type FunctionMapOutput struct{ *pulumi.OutputState }
func (FunctionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Function)(nil)).Elem()
}
func (o FunctionMapOutput) ToFunctionMapOutput() FunctionMapOutput {
return o
}
func (o FunctionMapOutput) ToFunctionMapOutputWithContext(ctx context.Context) FunctionMapOutput {
return o
}
func (o FunctionMapOutput) MapIndex(k pulumi.StringInput) FunctionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Function {
return vs[0].(map[string]*Function)[vs[1].(string)]
}).(FunctionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FunctionInput)(nil)).Elem(), &Function{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionArrayInput)(nil)).Elem(), FunctionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionMapInput)(nil)).Elem(), FunctionMap{})
pulumi.RegisterOutputType(FunctionOutput{})
pulumi.RegisterOutputType(FunctionArrayOutput{})
pulumi.RegisterOutputType(FunctionMapOutput{})
}