/
gtmGeomap.go
318 lines (267 loc) · 12.1 KB
/
gtmGeomap.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
// 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 trafficmanagement
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use the `GtmGeomap` resource to create, configure, and import a GTM Geographic map. Geographic mapping lets you configure a property that returns a CNAME based on the geographic location of the request.
//
// You can reuse maps for multiple properties or create new ones. To configure a property for geographic mapping, you need to define at least one geographic map for your domain. Each map needs at least two definitions. For example, you can have one definition that maps a set of countries to a specific data center, and a second definition that routes all other traffic.
//
// > **Note** Import requires an ID with this format: `existingDomainName`:`existingMapName`.
//
// ## Example Usage
//
// Basic usage:
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-akamai/sdk/v3/go/akamai"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := akamai.NewGtmGeomap(ctx, "demoGeomap", &akamai.GtmGeomapArgs{
// DefaultDatacenter: &GtmGeomapDefaultDatacenterArgs{
// DatacenterId: pulumi.Int(5400),
// Nickname: pulumi.String("All Others"),
// },
// Domain: pulumi.String("demo_domain.akadns.net"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// Deprecated: akamai.trafficmanagement.GtmGeomap has been deprecated in favor of akamai.GtmGeomap
type GtmGeomap struct {
pulumi.CustomResourceState
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
Assignments GtmGeomapAssignmentArrayOutput `pulumi:"assignments"`
// A placeholder for all other geographic zones. Requires these additional arguments:
DefaultDatacenter GtmGeomapDefaultDatacenterOutput `pulumi:"defaultDatacenter"`
// GTM Domain name for the Geographic Map.
Domain pulumi.StringOutput `pulumi:"domain"`
// A descriptive label for the Geographic map.
Name pulumi.StringOutput `pulumi:"name"`
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
WaitOnComplete pulumi.BoolPtrOutput `pulumi:"waitOnComplete"`
}
// NewGtmGeomap registers a new resource with the given unique name, arguments, and options.
func NewGtmGeomap(ctx *pulumi.Context,
name string, args *GtmGeomapArgs, opts ...pulumi.ResourceOption) (*GtmGeomap, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DefaultDatacenter == nil {
return nil, errors.New("invalid value for required argument 'DefaultDatacenter'")
}
if args.Domain == nil {
return nil, errors.New("invalid value for required argument 'Domain'")
}
var resource GtmGeomap
err := ctx.RegisterResource("akamai:trafficmanagement/gtmGeomap:GtmGeomap", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGtmGeomap gets an existing GtmGeomap 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 GetGtmGeomap(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GtmGeomapState, opts ...pulumi.ResourceOption) (*GtmGeomap, error) {
var resource GtmGeomap
err := ctx.ReadResource("akamai:trafficmanagement/gtmGeomap:GtmGeomap", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GtmGeomap resources.
type gtmGeomapState struct {
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
Assignments []GtmGeomapAssignment `pulumi:"assignments"`
// A placeholder for all other geographic zones. Requires these additional arguments:
DefaultDatacenter *GtmGeomapDefaultDatacenter `pulumi:"defaultDatacenter"`
// GTM Domain name for the Geographic Map.
Domain *string `pulumi:"domain"`
// A descriptive label for the Geographic map.
Name *string `pulumi:"name"`
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
type GtmGeomapState struct {
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
Assignments GtmGeomapAssignmentArrayInput
// A placeholder for all other geographic zones. Requires these additional arguments:
DefaultDatacenter GtmGeomapDefaultDatacenterPtrInput
// GTM Domain name for the Geographic Map.
Domain pulumi.StringPtrInput
// A descriptive label for the Geographic map.
Name pulumi.StringPtrInput
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmGeomapState) ElementType() reflect.Type {
return reflect.TypeOf((*gtmGeomapState)(nil)).Elem()
}
type gtmGeomapArgs struct {
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
Assignments []GtmGeomapAssignment `pulumi:"assignments"`
// A placeholder for all other geographic zones. Requires these additional arguments:
DefaultDatacenter GtmGeomapDefaultDatacenter `pulumi:"defaultDatacenter"`
// GTM Domain name for the Geographic Map.
Domain string `pulumi:"domain"`
// A descriptive label for the Geographic map.
Name *string `pulumi:"name"`
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
// The set of arguments for constructing a GtmGeomap resource.
type GtmGeomapArgs struct {
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
Assignments GtmGeomapAssignmentArrayInput
// A placeholder for all other geographic zones. Requires these additional arguments:
DefaultDatacenter GtmGeomapDefaultDatacenterInput
// GTM Domain name for the Geographic Map.
Domain pulumi.StringInput
// A descriptive label for the Geographic map.
Name pulumi.StringPtrInput
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmGeomapArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gtmGeomapArgs)(nil)).Elem()
}
type GtmGeomapInput interface {
pulumi.Input
ToGtmGeomapOutput() GtmGeomapOutput
ToGtmGeomapOutputWithContext(ctx context.Context) GtmGeomapOutput
}
func (*GtmGeomap) ElementType() reflect.Type {
return reflect.TypeOf((**GtmGeomap)(nil)).Elem()
}
func (i *GtmGeomap) ToGtmGeomapOutput() GtmGeomapOutput {
return i.ToGtmGeomapOutputWithContext(context.Background())
}
func (i *GtmGeomap) ToGtmGeomapOutputWithContext(ctx context.Context) GtmGeomapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmGeomapOutput)
}
// GtmGeomapArrayInput is an input type that accepts GtmGeomapArray and GtmGeomapArrayOutput values.
// You can construct a concrete instance of `GtmGeomapArrayInput` via:
//
// GtmGeomapArray{ GtmGeomapArgs{...} }
type GtmGeomapArrayInput interface {
pulumi.Input
ToGtmGeomapArrayOutput() GtmGeomapArrayOutput
ToGtmGeomapArrayOutputWithContext(context.Context) GtmGeomapArrayOutput
}
type GtmGeomapArray []GtmGeomapInput
func (GtmGeomapArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmGeomap)(nil)).Elem()
}
func (i GtmGeomapArray) ToGtmGeomapArrayOutput() GtmGeomapArrayOutput {
return i.ToGtmGeomapArrayOutputWithContext(context.Background())
}
func (i GtmGeomapArray) ToGtmGeomapArrayOutputWithContext(ctx context.Context) GtmGeomapArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmGeomapArrayOutput)
}
// GtmGeomapMapInput is an input type that accepts GtmGeomapMap and GtmGeomapMapOutput values.
// You can construct a concrete instance of `GtmGeomapMapInput` via:
//
// GtmGeomapMap{ "key": GtmGeomapArgs{...} }
type GtmGeomapMapInput interface {
pulumi.Input
ToGtmGeomapMapOutput() GtmGeomapMapOutput
ToGtmGeomapMapOutputWithContext(context.Context) GtmGeomapMapOutput
}
type GtmGeomapMap map[string]GtmGeomapInput
func (GtmGeomapMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmGeomap)(nil)).Elem()
}
func (i GtmGeomapMap) ToGtmGeomapMapOutput() GtmGeomapMapOutput {
return i.ToGtmGeomapMapOutputWithContext(context.Background())
}
func (i GtmGeomapMap) ToGtmGeomapMapOutputWithContext(ctx context.Context) GtmGeomapMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmGeomapMapOutput)
}
type GtmGeomapOutput struct{ *pulumi.OutputState }
func (GtmGeomapOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GtmGeomap)(nil)).Elem()
}
func (o GtmGeomapOutput) ToGtmGeomapOutput() GtmGeomapOutput {
return o
}
func (o GtmGeomapOutput) ToGtmGeomapOutputWithContext(ctx context.Context) GtmGeomapOutput {
return o
}
// Contains information about the geographic zone groupings of countries. You can have multiple `assignment` arguments. If used, requires these additional arguments:
func (o GtmGeomapOutput) Assignments() GtmGeomapAssignmentArrayOutput {
return o.ApplyT(func(v *GtmGeomap) GtmGeomapAssignmentArrayOutput { return v.Assignments }).(GtmGeomapAssignmentArrayOutput)
}
// A placeholder for all other geographic zones. Requires these additional arguments:
func (o GtmGeomapOutput) DefaultDatacenter() GtmGeomapDefaultDatacenterOutput {
return o.ApplyT(func(v *GtmGeomap) GtmGeomapDefaultDatacenterOutput { return v.DefaultDatacenter }).(GtmGeomapDefaultDatacenterOutput)
}
// GTM Domain name for the Geographic Map.
func (o GtmGeomapOutput) Domain() pulumi.StringOutput {
return o.ApplyT(func(v *GtmGeomap) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput)
}
// A descriptive label for the Geographic map.
func (o GtmGeomapOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GtmGeomap) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A boolean indicating whether to wait for transaction to complete. Set to `true` by default.
func (o GtmGeomapOutput) WaitOnComplete() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *GtmGeomap) pulumi.BoolPtrOutput { return v.WaitOnComplete }).(pulumi.BoolPtrOutput)
}
type GtmGeomapArrayOutput struct{ *pulumi.OutputState }
func (GtmGeomapArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmGeomap)(nil)).Elem()
}
func (o GtmGeomapArrayOutput) ToGtmGeomapArrayOutput() GtmGeomapArrayOutput {
return o
}
func (o GtmGeomapArrayOutput) ToGtmGeomapArrayOutputWithContext(ctx context.Context) GtmGeomapArrayOutput {
return o
}
func (o GtmGeomapArrayOutput) Index(i pulumi.IntInput) GtmGeomapOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GtmGeomap {
return vs[0].([]*GtmGeomap)[vs[1].(int)]
}).(GtmGeomapOutput)
}
type GtmGeomapMapOutput struct{ *pulumi.OutputState }
func (GtmGeomapMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmGeomap)(nil)).Elem()
}
func (o GtmGeomapMapOutput) ToGtmGeomapMapOutput() GtmGeomapMapOutput {
return o
}
func (o GtmGeomapMapOutput) ToGtmGeomapMapOutputWithContext(ctx context.Context) GtmGeomapMapOutput {
return o
}
func (o GtmGeomapMapOutput) MapIndex(k pulumi.StringInput) GtmGeomapOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GtmGeomap {
return vs[0].(map[string]*GtmGeomap)[vs[1].(string)]
}).(GtmGeomapOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GtmGeomapInput)(nil)).Elem(), &GtmGeomap{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmGeomapArrayInput)(nil)).Elem(), GtmGeomapArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmGeomapMapInput)(nil)).Elem(), GtmGeomapMap{})
pulumi.RegisterOutputType(GtmGeomapOutput{})
pulumi.RegisterOutputType(GtmGeomapArrayOutput{})
pulumi.RegisterOutputType(GtmGeomapMapOutput{})
}