/
endpointGroup.go
227 lines (192 loc) · 10.2 KB
/
endpointGroup.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 pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package globalaccelerator
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::GlobalAccelerator::EndpointGroup
type EndpointGroup struct {
pulumi.CustomResourceState
// The list of endpoint objects.
EndpointConfigurations EndpointGroupEndpointConfigurationArrayOutput `pulumi:"endpointConfigurations"`
// The Amazon Resource Name (ARN) of the endpoint group
EndpointGroupArn pulumi.StringOutput `pulumi:"endpointGroupArn"`
// The name of the AWS Region where the endpoint group is located
EndpointGroupRegion pulumi.StringOutput `pulumi:"endpointGroupRegion"`
// The time in seconds between each health check for an endpoint. Must be a value of 10 or 30
HealthCheckIntervalSeconds pulumi.IntPtrOutput `pulumi:"healthCheckIntervalSeconds"`
HealthCheckPath pulumi.StringPtrOutput `pulumi:"healthCheckPath"`
// The port that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckPort pulumi.IntPtrOutput `pulumi:"healthCheckPort"`
// The protocol that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckProtocol EndpointGroupHealthCheckProtocolPtrOutput `pulumi:"healthCheckProtocol"`
// The Amazon Resource Name (ARN) of the listener
ListenerArn pulumi.StringOutput `pulumi:"listenerArn"`
PortOverrides EndpointGroupPortOverrideArrayOutput `pulumi:"portOverrides"`
// The number of consecutive health checks required to set the state of the endpoint to unhealthy.
ThresholdCount pulumi.IntPtrOutput `pulumi:"thresholdCount"`
// The percentage of traffic to sent to an AWS Region
TrafficDialPercentage pulumi.Float64PtrOutput `pulumi:"trafficDialPercentage"`
}
// NewEndpointGroup registers a new resource with the given unique name, arguments, and options.
func NewEndpointGroup(ctx *pulumi.Context,
name string, args *EndpointGroupArgs, opts ...pulumi.ResourceOption) (*EndpointGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.EndpointGroupRegion == nil {
return nil, errors.New("invalid value for required argument 'EndpointGroupRegion'")
}
if args.ListenerArn == nil {
return nil, errors.New("invalid value for required argument 'ListenerArn'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"endpointGroupRegion",
"listenerArn",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource EndpointGroup
err := ctx.RegisterResource("aws-native:globalaccelerator:EndpointGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEndpointGroup gets an existing EndpointGroup 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 GetEndpointGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EndpointGroupState, opts ...pulumi.ResourceOption) (*EndpointGroup, error) {
var resource EndpointGroup
err := ctx.ReadResource("aws-native:globalaccelerator:EndpointGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EndpointGroup resources.
type endpointGroupState struct {
}
type EndpointGroupState struct {
}
func (EndpointGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*endpointGroupState)(nil)).Elem()
}
type endpointGroupArgs struct {
// The list of endpoint objects.
EndpointConfigurations []EndpointGroupEndpointConfiguration `pulumi:"endpointConfigurations"`
// The name of the AWS Region where the endpoint group is located
EndpointGroupRegion string `pulumi:"endpointGroupRegion"`
// The time in seconds between each health check for an endpoint. Must be a value of 10 or 30
HealthCheckIntervalSeconds *int `pulumi:"healthCheckIntervalSeconds"`
HealthCheckPath *string `pulumi:"healthCheckPath"`
// The port that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckPort *int `pulumi:"healthCheckPort"`
// The protocol that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckProtocol *EndpointGroupHealthCheckProtocol `pulumi:"healthCheckProtocol"`
// The Amazon Resource Name (ARN) of the listener
ListenerArn string `pulumi:"listenerArn"`
PortOverrides []EndpointGroupPortOverride `pulumi:"portOverrides"`
// The number of consecutive health checks required to set the state of the endpoint to unhealthy.
ThresholdCount *int `pulumi:"thresholdCount"`
// The percentage of traffic to sent to an AWS Region
TrafficDialPercentage *float64 `pulumi:"trafficDialPercentage"`
}
// The set of arguments for constructing a EndpointGroup resource.
type EndpointGroupArgs struct {
// The list of endpoint objects.
EndpointConfigurations EndpointGroupEndpointConfigurationArrayInput
// The name of the AWS Region where the endpoint group is located
EndpointGroupRegion pulumi.StringInput
// The time in seconds between each health check for an endpoint. Must be a value of 10 or 30
HealthCheckIntervalSeconds pulumi.IntPtrInput
HealthCheckPath pulumi.StringPtrInput
// The port that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckPort pulumi.IntPtrInput
// The protocol that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
HealthCheckProtocol EndpointGroupHealthCheckProtocolPtrInput
// The Amazon Resource Name (ARN) of the listener
ListenerArn pulumi.StringInput
PortOverrides EndpointGroupPortOverrideArrayInput
// The number of consecutive health checks required to set the state of the endpoint to unhealthy.
ThresholdCount pulumi.IntPtrInput
// The percentage of traffic to sent to an AWS Region
TrafficDialPercentage pulumi.Float64PtrInput
}
func (EndpointGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*endpointGroupArgs)(nil)).Elem()
}
type EndpointGroupInput interface {
pulumi.Input
ToEndpointGroupOutput() EndpointGroupOutput
ToEndpointGroupOutputWithContext(ctx context.Context) EndpointGroupOutput
}
func (*EndpointGroup) ElementType() reflect.Type {
return reflect.TypeOf((**EndpointGroup)(nil)).Elem()
}
func (i *EndpointGroup) ToEndpointGroupOutput() EndpointGroupOutput {
return i.ToEndpointGroupOutputWithContext(context.Background())
}
func (i *EndpointGroup) ToEndpointGroupOutputWithContext(ctx context.Context) EndpointGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(EndpointGroupOutput)
}
type EndpointGroupOutput struct{ *pulumi.OutputState }
func (EndpointGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EndpointGroup)(nil)).Elem()
}
func (o EndpointGroupOutput) ToEndpointGroupOutput() EndpointGroupOutput {
return o
}
func (o EndpointGroupOutput) ToEndpointGroupOutputWithContext(ctx context.Context) EndpointGroupOutput {
return o
}
// The list of endpoint objects.
func (o EndpointGroupOutput) EndpointConfigurations() EndpointGroupEndpointConfigurationArrayOutput {
return o.ApplyT(func(v *EndpointGroup) EndpointGroupEndpointConfigurationArrayOutput { return v.EndpointConfigurations }).(EndpointGroupEndpointConfigurationArrayOutput)
}
// The Amazon Resource Name (ARN) of the endpoint group
func (o EndpointGroupOutput) EndpointGroupArn() pulumi.StringOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.StringOutput { return v.EndpointGroupArn }).(pulumi.StringOutput)
}
// The name of the AWS Region where the endpoint group is located
func (o EndpointGroupOutput) EndpointGroupRegion() pulumi.StringOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.StringOutput { return v.EndpointGroupRegion }).(pulumi.StringOutput)
}
// The time in seconds between each health check for an endpoint. Must be a value of 10 or 30
func (o EndpointGroupOutput) HealthCheckIntervalSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.IntPtrOutput { return v.HealthCheckIntervalSeconds }).(pulumi.IntPtrOutput)
}
func (o EndpointGroupOutput) HealthCheckPath() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.StringPtrOutput { return v.HealthCheckPath }).(pulumi.StringPtrOutput)
}
// The port that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
func (o EndpointGroupOutput) HealthCheckPort() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.IntPtrOutput { return v.HealthCheckPort }).(pulumi.IntPtrOutput)
}
// The protocol that AWS Global Accelerator uses to check the health of endpoints in this endpoint group.
func (o EndpointGroupOutput) HealthCheckProtocol() EndpointGroupHealthCheckProtocolPtrOutput {
return o.ApplyT(func(v *EndpointGroup) EndpointGroupHealthCheckProtocolPtrOutput { return v.HealthCheckProtocol }).(EndpointGroupHealthCheckProtocolPtrOutput)
}
// The Amazon Resource Name (ARN) of the listener
func (o EndpointGroupOutput) ListenerArn() pulumi.StringOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.StringOutput { return v.ListenerArn }).(pulumi.StringOutput)
}
func (o EndpointGroupOutput) PortOverrides() EndpointGroupPortOverrideArrayOutput {
return o.ApplyT(func(v *EndpointGroup) EndpointGroupPortOverrideArrayOutput { return v.PortOverrides }).(EndpointGroupPortOverrideArrayOutput)
}
// The number of consecutive health checks required to set the state of the endpoint to unhealthy.
func (o EndpointGroupOutput) ThresholdCount() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.IntPtrOutput { return v.ThresholdCount }).(pulumi.IntPtrOutput)
}
// The percentage of traffic to sent to an AWS Region
func (o EndpointGroupOutput) TrafficDialPercentage() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *EndpointGroup) pulumi.Float64PtrOutput { return v.TrafficDialPercentage }).(pulumi.Float64PtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EndpointGroupInput)(nil)).Elem(), &EndpointGroup{})
pulumi.RegisterOutputType(EndpointGroupOutput{})
}