This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
targetGroup.go
257 lines (207 loc) · 8.82 KB
/
targetGroup.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
// 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 clb
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type TargetGroup struct {
pulumi.CustomResourceState
// The default port of target group, add server after can use it.
Port pulumi.IntPtrOutput `pulumi:"port"`
// The backend server of target group bind.
TargetGroupInstances TargetGroupTargetGroupInstanceArrayOutput `pulumi:"targetGroupInstances"`
// Target group name.
TargetGroupName pulumi.StringPtrOutput `pulumi:"targetGroupName"`
// VPC ID, default is based on the network.
VpcId pulumi.StringPtrOutput `pulumi:"vpcId"`
}
// NewTargetGroup registers a new resource with the given unique name, arguments, and options.
func NewTargetGroup(ctx *pulumi.Context,
name string, args *TargetGroupArgs, opts ...pulumi.ResourceOption) (*TargetGroup, error) {
if args == nil {
args = &TargetGroupArgs{}
}
var resource TargetGroup
err := ctx.RegisterResource("tctest:Clb/targetGroup:TargetGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTargetGroup gets an existing TargetGroup 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 GetTargetGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TargetGroupState, opts ...pulumi.ResourceOption) (*TargetGroup, error) {
var resource TargetGroup
err := ctx.ReadResource("tctest:Clb/targetGroup:TargetGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TargetGroup resources.
type targetGroupState struct {
// The default port of target group, add server after can use it.
Port *int `pulumi:"port"`
// The backend server of target group bind.
TargetGroupInstances []TargetGroupTargetGroupInstance `pulumi:"targetGroupInstances"`
// Target group name.
TargetGroupName *string `pulumi:"targetGroupName"`
// VPC ID, default is based on the network.
VpcId *string `pulumi:"vpcId"`
}
type TargetGroupState struct {
// The default port of target group, add server after can use it.
Port pulumi.IntPtrInput
// The backend server of target group bind.
TargetGroupInstances TargetGroupTargetGroupInstanceArrayInput
// Target group name.
TargetGroupName pulumi.StringPtrInput
// VPC ID, default is based on the network.
VpcId pulumi.StringPtrInput
}
func (TargetGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*targetGroupState)(nil)).Elem()
}
type targetGroupArgs struct {
// The default port of target group, add server after can use it.
Port *int `pulumi:"port"`
// The backend server of target group bind.
TargetGroupInstances []TargetGroupTargetGroupInstance `pulumi:"targetGroupInstances"`
// Target group name.
TargetGroupName *string `pulumi:"targetGroupName"`
// VPC ID, default is based on the network.
VpcId *string `pulumi:"vpcId"`
}
// The set of arguments for constructing a TargetGroup resource.
type TargetGroupArgs struct {
// The default port of target group, add server after can use it.
Port pulumi.IntPtrInput
// The backend server of target group bind.
TargetGroupInstances TargetGroupTargetGroupInstanceArrayInput
// Target group name.
TargetGroupName pulumi.StringPtrInput
// VPC ID, default is based on the network.
VpcId pulumi.StringPtrInput
}
func (TargetGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*targetGroupArgs)(nil)).Elem()
}
type TargetGroupInput interface {
pulumi.Input
ToTargetGroupOutput() TargetGroupOutput
ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput
}
func (*TargetGroup) ElementType() reflect.Type {
return reflect.TypeOf((**TargetGroup)(nil)).Elem()
}
func (i *TargetGroup) ToTargetGroupOutput() TargetGroupOutput {
return i.ToTargetGroupOutputWithContext(context.Background())
}
func (i *TargetGroup) ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupOutput)
}
// TargetGroupArrayInput is an input type that accepts TargetGroupArray and TargetGroupArrayOutput values.
// You can construct a concrete instance of `TargetGroupArrayInput` via:
//
// TargetGroupArray{ TargetGroupArgs{...} }
type TargetGroupArrayInput interface {
pulumi.Input
ToTargetGroupArrayOutput() TargetGroupArrayOutput
ToTargetGroupArrayOutputWithContext(context.Context) TargetGroupArrayOutput
}
type TargetGroupArray []TargetGroupInput
func (TargetGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TargetGroup)(nil)).Elem()
}
func (i TargetGroupArray) ToTargetGroupArrayOutput() TargetGroupArrayOutput {
return i.ToTargetGroupArrayOutputWithContext(context.Background())
}
func (i TargetGroupArray) ToTargetGroupArrayOutputWithContext(ctx context.Context) TargetGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupArrayOutput)
}
// TargetGroupMapInput is an input type that accepts TargetGroupMap and TargetGroupMapOutput values.
// You can construct a concrete instance of `TargetGroupMapInput` via:
//
// TargetGroupMap{ "key": TargetGroupArgs{...} }
type TargetGroupMapInput interface {
pulumi.Input
ToTargetGroupMapOutput() TargetGroupMapOutput
ToTargetGroupMapOutputWithContext(context.Context) TargetGroupMapOutput
}
type TargetGroupMap map[string]TargetGroupInput
func (TargetGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TargetGroup)(nil)).Elem()
}
func (i TargetGroupMap) ToTargetGroupMapOutput() TargetGroupMapOutput {
return i.ToTargetGroupMapOutputWithContext(context.Background())
}
func (i TargetGroupMap) ToTargetGroupMapOutputWithContext(ctx context.Context) TargetGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetGroupMapOutput)
}
type TargetGroupOutput struct{ *pulumi.OutputState }
func (TargetGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TargetGroup)(nil)).Elem()
}
func (o TargetGroupOutput) ToTargetGroupOutput() TargetGroupOutput {
return o
}
func (o TargetGroupOutput) ToTargetGroupOutputWithContext(ctx context.Context) TargetGroupOutput {
return o
}
// The default port of target group, add server after can use it.
func (o TargetGroupOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput)
}
// The backend server of target group bind.
func (o TargetGroupOutput) TargetGroupInstances() TargetGroupTargetGroupInstanceArrayOutput {
return o.ApplyT(func(v *TargetGroup) TargetGroupTargetGroupInstanceArrayOutput { return v.TargetGroupInstances }).(TargetGroupTargetGroupInstanceArrayOutput)
}
// Target group name.
func (o TargetGroupOutput) TargetGroupName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.TargetGroupName }).(pulumi.StringPtrOutput)
}
// VPC ID, default is based on the network.
func (o TargetGroupOutput) VpcId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetGroup) pulumi.StringPtrOutput { return v.VpcId }).(pulumi.StringPtrOutput)
}
type TargetGroupArrayOutput struct{ *pulumi.OutputState }
func (TargetGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TargetGroup)(nil)).Elem()
}
func (o TargetGroupArrayOutput) ToTargetGroupArrayOutput() TargetGroupArrayOutput {
return o
}
func (o TargetGroupArrayOutput) ToTargetGroupArrayOutputWithContext(ctx context.Context) TargetGroupArrayOutput {
return o
}
func (o TargetGroupArrayOutput) Index(i pulumi.IntInput) TargetGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TargetGroup {
return vs[0].([]*TargetGroup)[vs[1].(int)]
}).(TargetGroupOutput)
}
type TargetGroupMapOutput struct{ *pulumi.OutputState }
func (TargetGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TargetGroup)(nil)).Elem()
}
func (o TargetGroupMapOutput) ToTargetGroupMapOutput() TargetGroupMapOutput {
return o
}
func (o TargetGroupMapOutput) ToTargetGroupMapOutputWithContext(ctx context.Context) TargetGroupMapOutput {
return o
}
func (o TargetGroupMapOutput) MapIndex(k pulumi.StringInput) TargetGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TargetGroup {
return vs[0].(map[string]*TargetGroup)[vs[1].(string)]
}).(TargetGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupInput)(nil)).Elem(), &TargetGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupArrayInput)(nil)).Elem(), TargetGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TargetGroupMapInput)(nil)).Elem(), TargetGroupMap{})
pulumi.RegisterOutputType(TargetGroupOutput{})
pulumi.RegisterOutputType(TargetGroupArrayOutput{})
pulumi.RegisterOutputType(TargetGroupMapOutput{})
}