/
gtmCidrmap.go
322 lines (271 loc) · 12.5 KB
/
gtmCidrmap.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
// 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 `GtmCidrmap` resource to create, configure, and import a GTM Classless Inter-Domain Routing (CIDR) map. CIDR mapping uses the IP addresses of the requesting name server to provide IP-specific CNAME entries. CNAMEs let you direct internal users to a specific environment or direct them to the origin. This lets you provide different responses to an internal corporate DNS infrastructure, such as internal test environments and another answer for all other name servers (`defaultDatacenter`).
//
// CIDR maps split the Internet into multiple CIDR block zones. Properties that use a map can specify a handout CNAME for each zone on the property's editing page. To configure a property for CIDR mapping, your domain needs at least one CIDR map defined.
//
// > **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.NewGtmCidrmap(ctx, "demoCidrmap", &akamai.GtmCidrmapArgs{
// DefaultDatacenter: &GtmCidrmapDefaultDatacenterArgs{
// DatacenterId: pulumi.Int(5400),
// Nickname: pulumi.String("All Other CIDR Blocks"),
// },
// Domain: pulumi.String("demo_domain.akadns.net"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type GtmCidrmap struct {
pulumi.CustomResourceState
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
Assignments GtmCidrmapAssignmentArrayOutput `pulumi:"assignments"`
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
DefaultDatacenter GtmCidrmapDefaultDatacenterOutput `pulumi:"defaultDatacenter"`
// GTM Domain name for the AS Map.
Domain pulumi.StringOutput `pulumi:"domain"`
// A descriptive label for the CIDR map, up to 255 characters.
Name pulumi.StringOutput `pulumi:"name"`
// A boolean that, if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrOutput `pulumi:"waitOnComplete"`
}
// NewGtmCidrmap registers a new resource with the given unique name, arguments, and options.
func NewGtmCidrmap(ctx *pulumi.Context,
name string, args *GtmCidrmapArgs, opts ...pulumi.ResourceOption) (*GtmCidrmap, 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'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("akamai:trafficmanagement/gtmCidrmap:GtmCidrmap"),
},
})
opts = append(opts, aliases)
var resource GtmCidrmap
err := ctx.RegisterResource("akamai:index/gtmCidrmap:GtmCidrmap", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGtmCidrmap gets an existing GtmCidrmap 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 GetGtmCidrmap(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GtmCidrmapState, opts ...pulumi.ResourceOption) (*GtmCidrmap, error) {
var resource GtmCidrmap
err := ctx.ReadResource("akamai:index/gtmCidrmap:GtmCidrmap", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GtmCidrmap resources.
type gtmCidrmapState struct {
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
Assignments []GtmCidrmapAssignment `pulumi:"assignments"`
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
DefaultDatacenter *GtmCidrmapDefaultDatacenter `pulumi:"defaultDatacenter"`
// GTM Domain name for the AS Map.
Domain *string `pulumi:"domain"`
// A descriptive label for the CIDR map, up to 255 characters.
Name *string `pulumi:"name"`
// A boolean that, if set to `true`, waits for transaction to complete.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
type GtmCidrmapState struct {
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
Assignments GtmCidrmapAssignmentArrayInput
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
DefaultDatacenter GtmCidrmapDefaultDatacenterPtrInput
// GTM Domain name for the AS Map.
Domain pulumi.StringPtrInput
// A descriptive label for the CIDR map, up to 255 characters.
Name pulumi.StringPtrInput
// A boolean that, if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmCidrmapState) ElementType() reflect.Type {
return reflect.TypeOf((*gtmCidrmapState)(nil)).Elem()
}
type gtmCidrmapArgs struct {
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
Assignments []GtmCidrmapAssignment `pulumi:"assignments"`
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
DefaultDatacenter GtmCidrmapDefaultDatacenter `pulumi:"defaultDatacenter"`
// GTM Domain name for the AS Map.
Domain string `pulumi:"domain"`
// A descriptive label for the CIDR map, up to 255 characters.
Name *string `pulumi:"name"`
// A boolean that, if set to `true`, waits for transaction to complete.
WaitOnComplete *bool `pulumi:"waitOnComplete"`
}
// The set of arguments for constructing a GtmCidrmap resource.
type GtmCidrmapArgs struct {
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
Assignments GtmCidrmapAssignmentArrayInput
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
DefaultDatacenter GtmCidrmapDefaultDatacenterInput
// GTM Domain name for the AS Map.
Domain pulumi.StringInput
// A descriptive label for the CIDR map, up to 255 characters.
Name pulumi.StringPtrInput
// A boolean that, if set to `true`, waits for transaction to complete.
WaitOnComplete pulumi.BoolPtrInput
}
func (GtmCidrmapArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gtmCidrmapArgs)(nil)).Elem()
}
type GtmCidrmapInput interface {
pulumi.Input
ToGtmCidrmapOutput() GtmCidrmapOutput
ToGtmCidrmapOutputWithContext(ctx context.Context) GtmCidrmapOutput
}
func (*GtmCidrmap) ElementType() reflect.Type {
return reflect.TypeOf((**GtmCidrmap)(nil)).Elem()
}
func (i *GtmCidrmap) ToGtmCidrmapOutput() GtmCidrmapOutput {
return i.ToGtmCidrmapOutputWithContext(context.Background())
}
func (i *GtmCidrmap) ToGtmCidrmapOutputWithContext(ctx context.Context) GtmCidrmapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmCidrmapOutput)
}
// GtmCidrmapArrayInput is an input type that accepts GtmCidrmapArray and GtmCidrmapArrayOutput values.
// You can construct a concrete instance of `GtmCidrmapArrayInput` via:
//
// GtmCidrmapArray{ GtmCidrmapArgs{...} }
type GtmCidrmapArrayInput interface {
pulumi.Input
ToGtmCidrmapArrayOutput() GtmCidrmapArrayOutput
ToGtmCidrmapArrayOutputWithContext(context.Context) GtmCidrmapArrayOutput
}
type GtmCidrmapArray []GtmCidrmapInput
func (GtmCidrmapArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmCidrmap)(nil)).Elem()
}
func (i GtmCidrmapArray) ToGtmCidrmapArrayOutput() GtmCidrmapArrayOutput {
return i.ToGtmCidrmapArrayOutputWithContext(context.Background())
}
func (i GtmCidrmapArray) ToGtmCidrmapArrayOutputWithContext(ctx context.Context) GtmCidrmapArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmCidrmapArrayOutput)
}
// GtmCidrmapMapInput is an input type that accepts GtmCidrmapMap and GtmCidrmapMapOutput values.
// You can construct a concrete instance of `GtmCidrmapMapInput` via:
//
// GtmCidrmapMap{ "key": GtmCidrmapArgs{...} }
type GtmCidrmapMapInput interface {
pulumi.Input
ToGtmCidrmapMapOutput() GtmCidrmapMapOutput
ToGtmCidrmapMapOutputWithContext(context.Context) GtmCidrmapMapOutput
}
type GtmCidrmapMap map[string]GtmCidrmapInput
func (GtmCidrmapMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmCidrmap)(nil)).Elem()
}
func (i GtmCidrmapMap) ToGtmCidrmapMapOutput() GtmCidrmapMapOutput {
return i.ToGtmCidrmapMapOutputWithContext(context.Background())
}
func (i GtmCidrmapMap) ToGtmCidrmapMapOutputWithContext(ctx context.Context) GtmCidrmapMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GtmCidrmapMapOutput)
}
type GtmCidrmapOutput struct{ *pulumi.OutputState }
func (GtmCidrmapOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GtmCidrmap)(nil)).Elem()
}
func (o GtmCidrmapOutput) ToGtmCidrmapOutput() GtmCidrmapOutput {
return o
}
func (o GtmCidrmapOutput) ToGtmCidrmapOutputWithContext(ctx context.Context) GtmCidrmapOutput {
return o
}
// Contains information about the CIDR zone groupings of CIDR blocks. You can have multiple entries with this argument. If used, requires these additional arguments:
func (o GtmCidrmapOutput) Assignments() GtmCidrmapAssignmentArrayOutput {
return o.ApplyT(func(v *GtmCidrmap) GtmCidrmapAssignmentArrayOutput { return v.Assignments }).(GtmCidrmapAssignmentArrayOutput)
}
// A placeholder for all other CIDR zones not found in these CIDR zones. Requires these additional arguments:
func (o GtmCidrmapOutput) DefaultDatacenter() GtmCidrmapDefaultDatacenterOutput {
return o.ApplyT(func(v *GtmCidrmap) GtmCidrmapDefaultDatacenterOutput { return v.DefaultDatacenter }).(GtmCidrmapDefaultDatacenterOutput)
}
// GTM Domain name for the AS Map.
func (o GtmCidrmapOutput) Domain() pulumi.StringOutput {
return o.ApplyT(func(v *GtmCidrmap) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput)
}
// A descriptive label for the CIDR map, up to 255 characters.
func (o GtmCidrmapOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GtmCidrmap) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A boolean that, if set to `true`, waits for transaction to complete.
func (o GtmCidrmapOutput) WaitOnComplete() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *GtmCidrmap) pulumi.BoolPtrOutput { return v.WaitOnComplete }).(pulumi.BoolPtrOutput)
}
type GtmCidrmapArrayOutput struct{ *pulumi.OutputState }
func (GtmCidrmapArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GtmCidrmap)(nil)).Elem()
}
func (o GtmCidrmapArrayOutput) ToGtmCidrmapArrayOutput() GtmCidrmapArrayOutput {
return o
}
func (o GtmCidrmapArrayOutput) ToGtmCidrmapArrayOutputWithContext(ctx context.Context) GtmCidrmapArrayOutput {
return o
}
func (o GtmCidrmapArrayOutput) Index(i pulumi.IntInput) GtmCidrmapOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GtmCidrmap {
return vs[0].([]*GtmCidrmap)[vs[1].(int)]
}).(GtmCidrmapOutput)
}
type GtmCidrmapMapOutput struct{ *pulumi.OutputState }
func (GtmCidrmapMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GtmCidrmap)(nil)).Elem()
}
func (o GtmCidrmapMapOutput) ToGtmCidrmapMapOutput() GtmCidrmapMapOutput {
return o
}
func (o GtmCidrmapMapOutput) ToGtmCidrmapMapOutputWithContext(ctx context.Context) GtmCidrmapMapOutput {
return o
}
func (o GtmCidrmapMapOutput) MapIndex(k pulumi.StringInput) GtmCidrmapOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GtmCidrmap {
return vs[0].(map[string]*GtmCidrmap)[vs[1].(string)]
}).(GtmCidrmapOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GtmCidrmapInput)(nil)).Elem(), &GtmCidrmap{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmCidrmapArrayInput)(nil)).Elem(), GtmCidrmapArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GtmCidrmapMapInput)(nil)).Elem(), GtmCidrmapMap{})
pulumi.RegisterOutputType(GtmCidrmapOutput{})
pulumi.RegisterOutputType(GtmCidrmapArrayOutput{})
pulumi.RegisterOutputType(GtmCidrmapMapOutput{})
}