/
loadBalancerPool.go
167 lines (153 loc) · 10.8 KB
/
loadBalancerPool.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// nolint: lll
package cloudflare
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides a Cloudflare Load Balancer pool resource. This provides a pool of origins that can be used by a Cloudflare Load Balancer. Note that the load balancing feature must be enabled in your Cloudflare account before you can use this resource.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-cloudflare/blob/master/website/docs/r/load_balancer_pool.html.markdown.
type LoadBalancerPool struct {
pulumi.CustomResourceState
// A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://support.cloudflare.com/hc/en-us/articles/115000540888-Load-Balancing-Geographic-Regions).
CheckRegions pulumi.StringArrayOutput `pulumi:"checkRegions"`
// The RFC3339 timestamp of when the load balancer was created.
CreatedOn pulumi.StringOutput `pulumi:"createdOn"`
// Free text description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether to enable (the default) this origin within the Pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Default: 1.
MinimumOrigins pulumi.IntPtrOutput `pulumi:"minimumOrigins"`
// The RFC3339 timestamp of when the load balancer was last modified.
ModifiedOn pulumi.StringOutput `pulumi:"modifiedOn"`
// The ID of the Monitor to use for health checking origins within this pool.
Monitor pulumi.StringPtrOutput `pulumi:"monitor"`
// A human-identifiable name for the origin.
Name pulumi.StringOutput `pulumi:"name"`
// The email address to send health status notifications to. This can be an individual mailbox or a mailing list.
NotificationEmail pulumi.StringPtrOutput `pulumi:"notificationEmail"`
// The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. It's a complex value. See description below.
Origins LoadBalancerPoolOriginArrayOutput `pulumi:"origins"`
}
// NewLoadBalancerPool registers a new resource with the given unique name, arguments, and options.
func NewLoadBalancerPool(ctx *pulumi.Context,
name string, args *LoadBalancerPoolArgs, opts ...pulumi.ResourceOption) (*LoadBalancerPool, error) {
if args == nil || args.Name == nil {
return nil, errors.New("missing required argument 'Name'")
}
if args == nil || args.Origins == nil {
return nil, errors.New("missing required argument 'Origins'")
}
if args == nil {
args = &LoadBalancerPoolArgs{}
}
var resource LoadBalancerPool
err := ctx.RegisterResource("cloudflare:index/loadBalancerPool:LoadBalancerPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLoadBalancerPool gets an existing LoadBalancerPool 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 GetLoadBalancerPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LoadBalancerPoolState, opts ...pulumi.ResourceOption) (*LoadBalancerPool, error) {
var resource LoadBalancerPool
err := ctx.ReadResource("cloudflare:index/loadBalancerPool:LoadBalancerPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LoadBalancerPool resources.
type loadBalancerPoolState struct {
// A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://support.cloudflare.com/hc/en-us/articles/115000540888-Load-Balancing-Geographic-Regions).
CheckRegions []string `pulumi:"checkRegions"`
// The RFC3339 timestamp of when the load balancer was created.
CreatedOn *string `pulumi:"createdOn"`
// Free text description.
Description *string `pulumi:"description"`
// Whether to enable (the default) this origin within the Pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.
Enabled *bool `pulumi:"enabled"`
// The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Default: 1.
MinimumOrigins *int `pulumi:"minimumOrigins"`
// The RFC3339 timestamp of when the load balancer was last modified.
ModifiedOn *string `pulumi:"modifiedOn"`
// The ID of the Monitor to use for health checking origins within this pool.
Monitor *string `pulumi:"monitor"`
// A human-identifiable name for the origin.
Name *string `pulumi:"name"`
// The email address to send health status notifications to. This can be an individual mailbox or a mailing list.
NotificationEmail *string `pulumi:"notificationEmail"`
// The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. It's a complex value. See description below.
Origins []LoadBalancerPoolOrigin `pulumi:"origins"`
}
type LoadBalancerPoolState struct {
// A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://support.cloudflare.com/hc/en-us/articles/115000540888-Load-Balancing-Geographic-Regions).
CheckRegions pulumi.StringArrayInput
// The RFC3339 timestamp of when the load balancer was created.
CreatedOn pulumi.StringPtrInput
// Free text description.
Description pulumi.StringPtrInput
// Whether to enable (the default) this origin within the Pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.
Enabled pulumi.BoolPtrInput
// The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Default: 1.
MinimumOrigins pulumi.IntPtrInput
// The RFC3339 timestamp of when the load balancer was last modified.
ModifiedOn pulumi.StringPtrInput
// The ID of the Monitor to use for health checking origins within this pool.
Monitor pulumi.StringPtrInput
// A human-identifiable name for the origin.
Name pulumi.StringPtrInput
// The email address to send health status notifications to. This can be an individual mailbox or a mailing list.
NotificationEmail pulumi.StringPtrInput
// The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. It's a complex value. See description below.
Origins LoadBalancerPoolOriginArrayInput
}
func (LoadBalancerPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*loadBalancerPoolState)(nil)).Elem()
}
type loadBalancerPoolArgs struct {
// A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://support.cloudflare.com/hc/en-us/articles/115000540888-Load-Balancing-Geographic-Regions).
CheckRegions []string `pulumi:"checkRegions"`
// Free text description.
Description *string `pulumi:"description"`
// Whether to enable (the default) this origin within the Pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.
Enabled *bool `pulumi:"enabled"`
// The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Default: 1.
MinimumOrigins *int `pulumi:"minimumOrigins"`
// The ID of the Monitor to use for health checking origins within this pool.
Monitor *string `pulumi:"monitor"`
// A human-identifiable name for the origin.
Name string `pulumi:"name"`
// The email address to send health status notifications to. This can be an individual mailbox or a mailing list.
NotificationEmail *string `pulumi:"notificationEmail"`
// The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. It's a complex value. See description below.
Origins []LoadBalancerPoolOrigin `pulumi:"origins"`
}
// The set of arguments for constructing a LoadBalancerPool resource.
type LoadBalancerPoolArgs struct {
// A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://support.cloudflare.com/hc/en-us/articles/115000540888-Load-Balancing-Geographic-Regions).
CheckRegions pulumi.StringArrayInput
// Free text description.
Description pulumi.StringPtrInput
// Whether to enable (the default) this origin within the Pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.
Enabled pulumi.BoolPtrInput
// The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Default: 1.
MinimumOrigins pulumi.IntPtrInput
// The ID of the Monitor to use for health checking origins within this pool.
Monitor pulumi.StringPtrInput
// A human-identifiable name for the origin.
Name pulumi.StringInput
// The email address to send health status notifications to. This can be an individual mailbox or a mailing list.
NotificationEmail pulumi.StringPtrInput
// The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. It's a complex value. See description below.
Origins LoadBalancerPoolOriginArrayInput
}
func (LoadBalancerPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*loadBalancerPoolArgs)(nil)).Elem()
}