/
gtmDatacenter.go
419 lines (373 loc) · 19.4 KB
/
gtmDatacenter.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
// 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 akamai
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use the `GtmDatacenter` resource to create, configure, and import a GTM data center. A GTM data center represents a customer data center and is also known as a traffic target, a location containing many servers GTM can direct traffic to.
//
// GTM uses data centers to scale load balancing. For example, you might have data centers in both New York and Amsterdam and want to balance load between them. You can configure GTM to send US users to the New York data center and European users to the data center in Amsterdam.
//
// > **Note** Import requires an ID with this format: `existingDomainName`:`existingDatacenterId`.
//
// ## Example Usage
//
// Basic usage:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-akamai/sdk/v2/go/akamai"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := akamai.NewGtmDatacenter(ctx, "demoDatacenter", &akamai.GtmDatacenterArgs{
// Domain: pulumi.String("demo_domain.akadns.net"),
// Nickname: pulumi.String("demo_datacenter"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ## Schema reference
//
// You can download the GTM Data Center backing schema from the [Global Traffic Management API](https://developer.akamai.com/api/web_performance/global_traffic_management/v1.html#datacenter) page.
type GtmDatacenter struct {
pulumi.CustomResourceState
// The name of the city where the data center is located.
City pulumi.StringPtrOutput `pulumi:"city"`
// Identifies the data center's `datacenterId` of which this data center is a clone.
CloneOf pulumi.IntPtrOutput `pulumi:"cloneOf"`
// A boolean that, if set to `true`, Akamai's liveness test agents use the Host header configured in the liveness test.
CloudServerHostHeaderOverride pulumi.BoolPtrOutput `pulumi:"cloudServerHostHeaderOverride"`
// A boolean indicating whether to balance load between two or more servers in a cloud environment.
CloudServerTargeting pulumi.BoolPtrOutput `pulumi:"cloudServerTargeting"`
// A two-letter code that specifies the continent where the data center maps to.
Continent pulumi.StringPtrOutput `pulumi:"continent"`
// A two-letter ISO 3166 country code that specifies the country where the data center maps to.
Country pulumi.StringPtrOutput `pulumi:"country"`
// A unique identifier for an existing data center in the domain.
// * `pingInterval`
// * `pingPacketSize`
// * `scorePenalty`
// * `servermonitorLivenessCount`
// * `servermonitorLoadCount`
// * `servermonitorPool`
DatacenterId pulumi.IntOutput `pulumi:"datacenterId"`
// Specifies the load reporting interface between you and the GTM system. If used, requires these additional arguments:
DefaultLoadObject GtmDatacenterDefaultLoadObjectPtrOutput `pulumi:"defaultLoadObject"`
// The GTM domain name for the data center.
Domain pulumi.StringOutput `pulumi:"domain"`
// Specifies the geographical latitude of the data center's position. See also longitude within this object.
Latitude pulumi.Float64PtrOutput `pulumi:"latitude"`
// Specifies the geographic longitude of the data center's position. See also latitude within this object.
Longitude pulumi.Float64PtrOutput `pulumi:"longitude"`
// A descriptive label for the data center.
Nickname pulumi.StringPtrOutput `pulumi:"nickname"`
PingInterval pulumi.IntOutput `pulumi:"pingInterval"`
PingPacketSize pulumi.IntOutput `pulumi:"pingPacketSize"`
ScorePenalty pulumi.IntOutput `pulumi:"scorePenalty"`
ServermonitorLivenessCount pulumi.IntOutput `pulumi:"servermonitorLivenessCount"`
ServermonitorLoadCount pulumi.IntOutput `pulumi:"servermonitorLoadCount"`
ServermonitorPool pulumi.StringOutput `pulumi:"servermonitorPool"`
// Specifies a two-letter ISO 3166 country code for the state or province where the data center is located.
StateOrProvince pulumi.StringPtrOutput `pulumi:"stateOrProvince"`
// A boolean indicating whether the data center is virtual or physical, the latter meaning the data center has an Akamai Network Agent installed, and its physical location (`latitude`, `longitude`) is fixed. Either `true` if virtual or `false` if physical.
Virtual pulumi.BoolOutput `pulumi:"virtual"`
// A boolean, that if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrOutput `pulumi:"waitOnComplete"`
}
// NewGtmDatacenter registers a new resource with the given unique name, arguments, and options.
func NewGtmDatacenter(ctx *pulumi.Context,
name string, args *GtmDatacenterArgs, opts ...pulumi.ResourceOption) (*GtmDatacenter, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Domain == nil {
return nil, errors.New("invalid value for required argument 'Domain'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("akamai:trafficmanagement/gtmDatacenter:GtmDatacenter"),
},
})
opts = append(opts, aliases)
var resource GtmDatacenter
err := ctx.RegisterResource("akamai:index/gtmDatacenter:GtmDatacenter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGtmDatacenter gets an existing GtmDatacenter 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 GetGtmDatacenter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GtmDatacenterState, opts ...pulumi.ResourceOption) (*GtmDatacenter, error) {
var resource GtmDatacenter
err := ctx.ReadResource("akamai:index/gtmDatacenter:GtmDatacenter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GtmDatacenter resources.
type gtmDatacenterState struct {
// The name of the city where the data center is located.
City *string `pulumi:"city"`
// Identifies the data center's `datacenterId` of which this data center is a clone.
CloneOf *int `pulumi:"cloneOf"`
// A boolean that, if set to `true`, Akamai's liveness test agents use the Host header configured in the liveness test.
CloudServerHostHeaderOverride *bool `pulumi:"cloudServerHostHeaderOverride"`
// A boolean indicating whether to balance load between two or more servers in a cloud environment.
CloudServerTargeting *bool `pulumi:"cloudServerTargeting"`
// A two-letter code that specifies the continent where the data center maps to.
Continent *string `pulumi:"continent"`
// A two-letter ISO 3166 country code that specifies the country where the data center maps to.
Country *string `pulumi:"country"`
// A unique identifier for an existing data center in the domain.
// * `pingInterval`
// * `pingPacketSize`
// * `scorePenalty`
// * `servermonitorLivenessCount`
// * `servermonitorLoadCount`
// * `servermonitorPool`
DatacenterId *int `pulumi:"datacenterId"`
// Specifies the load reporting interface between you and the GTM system. If used, requires these additional arguments:
DefaultLoadObject *GtmDatacenterDefaultLoadObject `pulumi:"defaultLoadObject"`
// The GTM domain name for the data center.
Domain *string `pulumi:"domain"`
// Specifies the geographical latitude of the data center's position. See also longitude within this object.
Latitude *float64 `pulumi:"latitude"`
// Specifies the geographic longitude of the data center's position. See also latitude within this object.
Longitude *float64 `pulumi:"longitude"`
// A descriptive label for the data center.
Nickname *string `pulumi:"nickname"`
PingInterval *int `pulumi:"pingInterval"`
PingPacketSize *int `pulumi:"pingPacketSize"`
ScorePenalty *int `pulumi:"scorePenalty"`
ServermonitorLivenessCount *int `pulumi:"servermonitorLivenessCount"`
ServermonitorLoadCount *int `pulumi:"servermonitorLoadCount"`
ServermonitorPool *string `pulumi:"servermonitorPool"`
// Specifies a two-letter ISO 3166 country code for the state or province where the data center is located.
StateOrProvince *string `pulumi:"stateOrProvince"`
// A boolean indicating whether the data center is virtual or physical, the latter meaning the data center has an Akamai Network Agent installed, and its physical location (`latitude`, `longitude`) is fixed. Either `true` if virtual or `false` if physical.
Virtual *bool `pulumi:"virtual"`
// A boolean, that if set to `true`, waits for transaction to complete.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
type GtmDatacenterState struct {
// The name of the city where the data center is located.
City pulumi.StringPtrInput
// Identifies the data center's `datacenterId` of which this data center is a clone.
CloneOf pulumi.IntPtrInput
// A boolean that, if set to `true`, Akamai's liveness test agents use the Host header configured in the liveness test.
CloudServerHostHeaderOverride pulumi.BoolPtrInput
// A boolean indicating whether to balance load between two or more servers in a cloud environment.
CloudServerTargeting pulumi.BoolPtrInput
// A two-letter code that specifies the continent where the data center maps to.
Continent pulumi.StringPtrInput
// A two-letter ISO 3166 country code that specifies the country where the data center maps to.
Country pulumi.StringPtrInput
// A unique identifier for an existing data center in the domain.
// * `pingInterval`
// * `pingPacketSize`
// * `scorePenalty`
// * `servermonitorLivenessCount`
// * `servermonitorLoadCount`
// * `servermonitorPool`
DatacenterId pulumi.IntPtrInput
// Specifies the load reporting interface between you and the GTM system. If used, requires these additional arguments:
DefaultLoadObject GtmDatacenterDefaultLoadObjectPtrInput
// The GTM domain name for the data center.
Domain pulumi.StringPtrInput
// Specifies the geographical latitude of the data center's position. See also longitude within this object.
Latitude pulumi.Float64PtrInput
// Specifies the geographic longitude of the data center's position. See also latitude within this object.
Longitude pulumi.Float64PtrInput
// A descriptive label for the data center.
Nickname pulumi.StringPtrInput
PingInterval pulumi.IntPtrInput
PingPacketSize pulumi.IntPtrInput
ScorePenalty pulumi.IntPtrInput
ServermonitorLivenessCount pulumi.IntPtrInput
ServermonitorLoadCount pulumi.IntPtrInput
ServermonitorPool pulumi.StringPtrInput
// Specifies a two-letter ISO 3166 country code for the state or province where the data center is located.
StateOrProvince pulumi.StringPtrInput
// A boolean indicating whether the data center is virtual or physical, the latter meaning the data center has an Akamai Network Agent installed, and its physical location (`latitude`, `longitude`) is fixed. Either `true` if virtual or `false` if physical.
Virtual pulumi.BoolPtrInput
// A boolean, that if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmDatacenterState) ElementType() reflect.Type {
return reflect.TypeOf((*gtmDatacenterState)(nil)).Elem()
}
type gtmDatacenterArgs struct {
// The name of the city where the data center is located.
City *string `pulumi:"city"`
// Identifies the data center's `datacenterId` of which this data center is a clone.
CloneOf *int `pulumi:"cloneOf"`
// A boolean that, if set to `true`, Akamai's liveness test agents use the Host header configured in the liveness test.
CloudServerHostHeaderOverride *bool `pulumi:"cloudServerHostHeaderOverride"`
// A boolean indicating whether to balance load between two or more servers in a cloud environment.
CloudServerTargeting *bool `pulumi:"cloudServerTargeting"`
// A two-letter code that specifies the continent where the data center maps to.
Continent *string `pulumi:"continent"`
// A two-letter ISO 3166 country code that specifies the country where the data center maps to.
Country *string `pulumi:"country"`
// Specifies the load reporting interface between you and the GTM system. If used, requires these additional arguments:
DefaultLoadObject *GtmDatacenterDefaultLoadObject `pulumi:"defaultLoadObject"`
// The GTM domain name for the data center.
Domain string `pulumi:"domain"`
// Specifies the geographical latitude of the data center's position. See also longitude within this object.
Latitude *float64 `pulumi:"latitude"`
// Specifies the geographic longitude of the data center's position. See also latitude within this object.
Longitude *float64 `pulumi:"longitude"`
// A descriptive label for the data center.
Nickname *string `pulumi:"nickname"`
// Specifies a two-letter ISO 3166 country code for the state or province where the data center is located.
StateOrProvince *string `pulumi:"stateOrProvince"`
// A boolean, that if set to `true`, waits for transaction to complete.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
// The set of arguments for constructing a GtmDatacenter resource.
type GtmDatacenterArgs struct {
// The name of the city where the data center is located.
City pulumi.StringPtrInput
// Identifies the data center's `datacenterId` of which this data center is a clone.
CloneOf pulumi.IntPtrInput
// A boolean that, if set to `true`, Akamai's liveness test agents use the Host header configured in the liveness test.
CloudServerHostHeaderOverride pulumi.BoolPtrInput
// A boolean indicating whether to balance load between two or more servers in a cloud environment.
CloudServerTargeting pulumi.BoolPtrInput
// A two-letter code that specifies the continent where the data center maps to.
Continent pulumi.StringPtrInput
// A two-letter ISO 3166 country code that specifies the country where the data center maps to.
Country pulumi.StringPtrInput
// Specifies the load reporting interface between you and the GTM system. If used, requires these additional arguments:
DefaultLoadObject GtmDatacenterDefaultLoadObjectPtrInput
// The GTM domain name for the data center.
Domain pulumi.StringInput
// Specifies the geographical latitude of the data center's position. See also longitude within this object.
Latitude pulumi.Float64PtrInput
// Specifies the geographic longitude of the data center's position. See also latitude within this object.
Longitude pulumi.Float64PtrInput
// A descriptive label for the data center.
Nickname pulumi.StringPtrInput
// Specifies a two-letter ISO 3166 country code for the state or province where the data center is located.
StateOrProvince pulumi.StringPtrInput
// A boolean, that if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmDatacenterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gtmDatacenterArgs)(nil)).Elem()
}
type GtmDatacenterInput interface {
pulumi.Input
ToGtmDatacenterOutput() GtmDatacenterOutput
ToGtmDatacenterOutputWithContext(ctx context.Context) GtmDatacenterOutput
}
func (*GtmDatacenter) ElementType() reflect.Type {
return reflect.TypeOf((**GtmDatacenter)(nil)).Elem()
}
func (i *GtmDatacenter) ToGtmDatacenterOutput() GtmDatacenterOutput {
return i.ToGtmDatacenterOutputWithContext(context.Background())
}
func (i *GtmDatacenter) ToGtmDatacenterOutputWithContext(ctx context.Context) GtmDatacenterOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmDatacenterOutput)
}
// GtmDatacenterArrayInput is an input type that accepts GtmDatacenterArray and GtmDatacenterArrayOutput values.
// You can construct a concrete instance of `GtmDatacenterArrayInput` via:
//
// GtmDatacenterArray{ GtmDatacenterArgs{...} }
type GtmDatacenterArrayInput interface {
pulumi.Input
ToGtmDatacenterArrayOutput() GtmDatacenterArrayOutput
ToGtmDatacenterArrayOutputWithContext(context.Context) GtmDatacenterArrayOutput
}
type GtmDatacenterArray []GtmDatacenterInput
func (GtmDatacenterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmDatacenter)(nil)).Elem()
}
func (i GtmDatacenterArray) ToGtmDatacenterArrayOutput() GtmDatacenterArrayOutput {
return i.ToGtmDatacenterArrayOutputWithContext(context.Background())
}
func (i GtmDatacenterArray) ToGtmDatacenterArrayOutputWithContext(ctx context.Context) GtmDatacenterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmDatacenterArrayOutput)
}
// GtmDatacenterMapInput is an input type that accepts GtmDatacenterMap and GtmDatacenterMapOutput values.
// You can construct a concrete instance of `GtmDatacenterMapInput` via:
//
// GtmDatacenterMap{ "key": GtmDatacenterArgs{...} }
type GtmDatacenterMapInput interface {
pulumi.Input
ToGtmDatacenterMapOutput() GtmDatacenterMapOutput
ToGtmDatacenterMapOutputWithContext(context.Context) GtmDatacenterMapOutput
}
type GtmDatacenterMap map[string]GtmDatacenterInput
func (GtmDatacenterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmDatacenter)(nil)).Elem()
}
func (i GtmDatacenterMap) ToGtmDatacenterMapOutput() GtmDatacenterMapOutput {
return i.ToGtmDatacenterMapOutputWithContext(context.Background())
}
func (i GtmDatacenterMap) ToGtmDatacenterMapOutputWithContext(ctx context.Context) GtmDatacenterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmDatacenterMapOutput)
}
type GtmDatacenterOutput struct{ *pulumi.OutputState }
func (GtmDatacenterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GtmDatacenter)(nil)).Elem()
}
func (o GtmDatacenterOutput) ToGtmDatacenterOutput() GtmDatacenterOutput {
return o
}
func (o GtmDatacenterOutput) ToGtmDatacenterOutputWithContext(ctx context.Context) GtmDatacenterOutput {
return o
}
type GtmDatacenterArrayOutput struct{ *pulumi.OutputState }
func (GtmDatacenterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmDatacenter)(nil)).Elem()
}
func (o GtmDatacenterArrayOutput) ToGtmDatacenterArrayOutput() GtmDatacenterArrayOutput {
return o
}
func (o GtmDatacenterArrayOutput) ToGtmDatacenterArrayOutputWithContext(ctx context.Context) GtmDatacenterArrayOutput {
return o
}
func (o GtmDatacenterArrayOutput) Index(i pulumi.IntInput) GtmDatacenterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GtmDatacenter {
return vs[0].([]*GtmDatacenter)[vs[1].(int)]
}).(GtmDatacenterOutput)
}
type GtmDatacenterMapOutput struct{ *pulumi.OutputState }
func (GtmDatacenterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmDatacenter)(nil)).Elem()
}
func (o GtmDatacenterMapOutput) ToGtmDatacenterMapOutput() GtmDatacenterMapOutput {
return o
}
func (o GtmDatacenterMapOutput) ToGtmDatacenterMapOutputWithContext(ctx context.Context) GtmDatacenterMapOutput {
return o
}
func (o GtmDatacenterMapOutput) MapIndex(k pulumi.StringInput) GtmDatacenterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GtmDatacenter {
return vs[0].(map[string]*GtmDatacenter)[vs[1].(string)]
}).(GtmDatacenterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GtmDatacenterInput)(nil)).Elem(), &GtmDatacenter{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmDatacenterArrayInput)(nil)).Elem(), GtmDatacenterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmDatacenterMapInput)(nil)).Elem(), GtmDatacenterMap{})
pulumi.RegisterOutputType(GtmDatacenterOutput{})
pulumi.RegisterOutputType(GtmDatacenterArrayOutput{})
pulumi.RegisterOutputType(GtmDatacenterMapOutput{})
}