/
customRoutingAccelerator.go
396 lines (340 loc) · 19.4 KB
/
customRoutingAccelerator.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
// 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 globalaccelerator
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a Global Accelerator custom routing accelerator.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := globalaccelerator.NewCustomRoutingAccelerator(ctx, "example", &globalaccelerator.CustomRoutingAcceleratorArgs{
// Name: pulumi.String("Example"),
// IpAddressType: pulumi.String("IPV4"),
// IpAddresses: pulumi.StringArray{
// pulumi.String("1.2.3.4"),
// },
// Enabled: pulumi.Bool(true),
// Attributes: &globalaccelerator.CustomRoutingAcceleratorAttributesArgs{
// FlowLogsEnabled: pulumi.Bool(true),
// FlowLogsS3Bucket: pulumi.String("example-bucket"),
// FlowLogsS3Prefix: pulumi.String("flow-logs/"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import Global Accelerator custom routing accelerators using the `arn`. For example:
//
// ```sh
// $ pulumi import aws:globalaccelerator/customRoutingAccelerator:CustomRoutingAccelerator example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// ```
type CustomRoutingAccelerator struct {
pulumi.CustomResourceState
// The attributes of the accelerator. Fields documented below.
Attributes CustomRoutingAcceleratorAttributesPtrOutput `pulumi:"attributes"`
// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
DnsName pulumi.StringOutput `pulumi:"dnsName"`
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// - The Global Accelerator Route 53 zone ID that can be used to
// route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
// is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"`
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
IpAddressType pulumi.StringPtrOutput `pulumi:"ipAddressType"`
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
IpAddresses pulumi.StringArrayOutput `pulumi:"ipAddresses"`
// IP address set associated with the accelerator.
IpSets CustomRoutingAcceleratorIpSetArrayOutput `pulumi:"ipSets"`
// The name of a custom routing accelerator.
Name pulumi.StringOutput `pulumi:"name"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewCustomRoutingAccelerator registers a new resource with the given unique name, arguments, and options.
func NewCustomRoutingAccelerator(ctx *pulumi.Context,
name string, args *CustomRoutingAcceleratorArgs, opts ...pulumi.ResourceOption) (*CustomRoutingAccelerator, error) {
if args == nil {
args = &CustomRoutingAcceleratorArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CustomRoutingAccelerator
err := ctx.RegisterResource("aws:globalaccelerator/customRoutingAccelerator:CustomRoutingAccelerator", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCustomRoutingAccelerator gets an existing CustomRoutingAccelerator 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 GetCustomRoutingAccelerator(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CustomRoutingAcceleratorState, opts ...pulumi.ResourceOption) (*CustomRoutingAccelerator, error) {
var resource CustomRoutingAccelerator
err := ctx.ReadResource("aws:globalaccelerator/customRoutingAccelerator:CustomRoutingAccelerator", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CustomRoutingAccelerator resources.
type customRoutingAcceleratorState struct {
// The attributes of the accelerator. Fields documented below.
Attributes *CustomRoutingAcceleratorAttributes `pulumi:"attributes"`
// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
DnsName *string `pulumi:"dnsName"`
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
Enabled *bool `pulumi:"enabled"`
// - The Global Accelerator Route 53 zone ID that can be used to
// route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
// is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
HostedZoneId *string `pulumi:"hostedZoneId"`
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
IpAddressType *string `pulumi:"ipAddressType"`
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
IpAddresses []string `pulumi:"ipAddresses"`
// IP address set associated with the accelerator.
IpSets []CustomRoutingAcceleratorIpSet `pulumi:"ipSets"`
// The name of a custom routing accelerator.
Name *string `pulumi:"name"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type CustomRoutingAcceleratorState struct {
// The attributes of the accelerator. Fields documented below.
Attributes CustomRoutingAcceleratorAttributesPtrInput
// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
DnsName pulumi.StringPtrInput
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
Enabled pulumi.BoolPtrInput
// - The Global Accelerator Route 53 zone ID that can be used to
// route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
// is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
HostedZoneId pulumi.StringPtrInput
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
IpAddressType pulumi.StringPtrInput
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
IpAddresses pulumi.StringArrayInput
// IP address set associated with the accelerator.
IpSets CustomRoutingAcceleratorIpSetArrayInput
// The name of a custom routing accelerator.
Name pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
}
func (CustomRoutingAcceleratorState) ElementType() reflect.Type {
return reflect.TypeOf((*customRoutingAcceleratorState)(nil)).Elem()
}
type customRoutingAcceleratorArgs struct {
// The attributes of the accelerator. Fields documented below.
Attributes *CustomRoutingAcceleratorAttributes `pulumi:"attributes"`
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
Enabled *bool `pulumi:"enabled"`
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
IpAddressType *string `pulumi:"ipAddressType"`
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
IpAddresses []string `pulumi:"ipAddresses"`
// The name of a custom routing accelerator.
Name *string `pulumi:"name"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a CustomRoutingAccelerator resource.
type CustomRoutingAcceleratorArgs struct {
// The attributes of the accelerator. Fields documented below.
Attributes CustomRoutingAcceleratorAttributesPtrInput
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
Enabled pulumi.BoolPtrInput
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
IpAddressType pulumi.StringPtrInput
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
IpAddresses pulumi.StringArrayInput
// The name of a custom routing accelerator.
Name pulumi.StringPtrInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (CustomRoutingAcceleratorArgs) ElementType() reflect.Type {
return reflect.TypeOf((*customRoutingAcceleratorArgs)(nil)).Elem()
}
type CustomRoutingAcceleratorInput interface {
pulumi.Input
ToCustomRoutingAcceleratorOutput() CustomRoutingAcceleratorOutput
ToCustomRoutingAcceleratorOutputWithContext(ctx context.Context) CustomRoutingAcceleratorOutput
}
func (*CustomRoutingAccelerator) ElementType() reflect.Type {
return reflect.TypeOf((**CustomRoutingAccelerator)(nil)).Elem()
}
func (i *CustomRoutingAccelerator) ToCustomRoutingAcceleratorOutput() CustomRoutingAcceleratorOutput {
return i.ToCustomRoutingAcceleratorOutputWithContext(context.Background())
}
func (i *CustomRoutingAccelerator) ToCustomRoutingAcceleratorOutputWithContext(ctx context.Context) CustomRoutingAcceleratorOutput {
return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingAcceleratorOutput)
}
// CustomRoutingAcceleratorArrayInput is an input type that accepts CustomRoutingAcceleratorArray and CustomRoutingAcceleratorArrayOutput values.
// You can construct a concrete instance of `CustomRoutingAcceleratorArrayInput` via:
//
// CustomRoutingAcceleratorArray{ CustomRoutingAcceleratorArgs{...} }
type CustomRoutingAcceleratorArrayInput interface {
pulumi.Input
ToCustomRoutingAcceleratorArrayOutput() CustomRoutingAcceleratorArrayOutput
ToCustomRoutingAcceleratorArrayOutputWithContext(context.Context) CustomRoutingAcceleratorArrayOutput
}
type CustomRoutingAcceleratorArray []CustomRoutingAcceleratorInput
func (CustomRoutingAcceleratorArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CustomRoutingAccelerator)(nil)).Elem()
}
func (i CustomRoutingAcceleratorArray) ToCustomRoutingAcceleratorArrayOutput() CustomRoutingAcceleratorArrayOutput {
return i.ToCustomRoutingAcceleratorArrayOutputWithContext(context.Background())
}
func (i CustomRoutingAcceleratorArray) ToCustomRoutingAcceleratorArrayOutputWithContext(ctx context.Context) CustomRoutingAcceleratorArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingAcceleratorArrayOutput)
}
// CustomRoutingAcceleratorMapInput is an input type that accepts CustomRoutingAcceleratorMap and CustomRoutingAcceleratorMapOutput values.
// You can construct a concrete instance of `CustomRoutingAcceleratorMapInput` via:
//
// CustomRoutingAcceleratorMap{ "key": CustomRoutingAcceleratorArgs{...} }
type CustomRoutingAcceleratorMapInput interface {
pulumi.Input
ToCustomRoutingAcceleratorMapOutput() CustomRoutingAcceleratorMapOutput
ToCustomRoutingAcceleratorMapOutputWithContext(context.Context) CustomRoutingAcceleratorMapOutput
}
type CustomRoutingAcceleratorMap map[string]CustomRoutingAcceleratorInput
func (CustomRoutingAcceleratorMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CustomRoutingAccelerator)(nil)).Elem()
}
func (i CustomRoutingAcceleratorMap) ToCustomRoutingAcceleratorMapOutput() CustomRoutingAcceleratorMapOutput {
return i.ToCustomRoutingAcceleratorMapOutputWithContext(context.Background())
}
func (i CustomRoutingAcceleratorMap) ToCustomRoutingAcceleratorMapOutputWithContext(ctx context.Context) CustomRoutingAcceleratorMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CustomRoutingAcceleratorMapOutput)
}
type CustomRoutingAcceleratorOutput struct{ *pulumi.OutputState }
func (CustomRoutingAcceleratorOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CustomRoutingAccelerator)(nil)).Elem()
}
func (o CustomRoutingAcceleratorOutput) ToCustomRoutingAcceleratorOutput() CustomRoutingAcceleratorOutput {
return o
}
func (o CustomRoutingAcceleratorOutput) ToCustomRoutingAcceleratorOutputWithContext(ctx context.Context) CustomRoutingAcceleratorOutput {
return o
}
// The attributes of the accelerator. Fields documented below.
func (o CustomRoutingAcceleratorOutput) Attributes() CustomRoutingAcceleratorAttributesPtrOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) CustomRoutingAcceleratorAttributesPtrOutput { return v.Attributes }).(CustomRoutingAcceleratorAttributesPtrOutput)
}
// The DNS name of the accelerator. For example, `a5d53ff5ee6bca4ce.awsglobalaccelerator.com`.
func (o CustomRoutingAcceleratorOutput) DnsName() pulumi.StringOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringOutput { return v.DnsName }).(pulumi.StringOutput)
}
// Indicates whether the accelerator is enabled. Defaults to `true`. Valid values: `true`, `false`.
func (o CustomRoutingAcceleratorOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// - The Global Accelerator Route 53 zone ID that can be used to
// route an [Alias Resource Record Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html) to the Global Accelerator. This attribute
// is simply an alias for the zone ID `Z2BJ6XQ5FK7U4H`.
func (o CustomRoutingAcceleratorOutput) HostedZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput)
}
// The IP address type that an accelerator supports. For a custom routing accelerator, the value must be `"IPV4"`.
func (o CustomRoutingAcceleratorOutput) IpAddressType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringPtrOutput { return v.IpAddressType }).(pulumi.StringPtrOutput)
}
// The IP addresses to use for BYOIP accelerators. If not specified, the service assigns IP addresses. Valid values: 1 or 2 IPv4 addresses.
func (o CustomRoutingAcceleratorOutput) IpAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringArrayOutput { return v.IpAddresses }).(pulumi.StringArrayOutput)
}
// IP address set associated with the accelerator.
func (o CustomRoutingAcceleratorOutput) IpSets() CustomRoutingAcceleratorIpSetArrayOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) CustomRoutingAcceleratorIpSetArrayOutput { return v.IpSets }).(CustomRoutingAcceleratorIpSetArrayOutput)
}
// The name of a custom routing accelerator.
func (o CustomRoutingAcceleratorOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o CustomRoutingAcceleratorOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o CustomRoutingAcceleratorOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *CustomRoutingAccelerator) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type CustomRoutingAcceleratorArrayOutput struct{ *pulumi.OutputState }
func (CustomRoutingAcceleratorArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CustomRoutingAccelerator)(nil)).Elem()
}
func (o CustomRoutingAcceleratorArrayOutput) ToCustomRoutingAcceleratorArrayOutput() CustomRoutingAcceleratorArrayOutput {
return o
}
func (o CustomRoutingAcceleratorArrayOutput) ToCustomRoutingAcceleratorArrayOutputWithContext(ctx context.Context) CustomRoutingAcceleratorArrayOutput {
return o
}
func (o CustomRoutingAcceleratorArrayOutput) Index(i pulumi.IntInput) CustomRoutingAcceleratorOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomRoutingAccelerator {
return vs[0].([]*CustomRoutingAccelerator)[vs[1].(int)]
}).(CustomRoutingAcceleratorOutput)
}
type CustomRoutingAcceleratorMapOutput struct{ *pulumi.OutputState }
func (CustomRoutingAcceleratorMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CustomRoutingAccelerator)(nil)).Elem()
}
func (o CustomRoutingAcceleratorMapOutput) ToCustomRoutingAcceleratorMapOutput() CustomRoutingAcceleratorMapOutput {
return o
}
func (o CustomRoutingAcceleratorMapOutput) ToCustomRoutingAcceleratorMapOutputWithContext(ctx context.Context) CustomRoutingAcceleratorMapOutput {
return o
}
func (o CustomRoutingAcceleratorMapOutput) MapIndex(k pulumi.StringInput) CustomRoutingAcceleratorOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomRoutingAccelerator {
return vs[0].(map[string]*CustomRoutingAccelerator)[vs[1].(string)]
}).(CustomRoutingAcceleratorOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingAcceleratorInput)(nil)).Elem(), &CustomRoutingAccelerator{})
pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingAcceleratorArrayInput)(nil)).Elem(), CustomRoutingAcceleratorArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CustomRoutingAcceleratorMapInput)(nil)).Elem(), CustomRoutingAcceleratorMap{})
pulumi.RegisterOutputType(CustomRoutingAcceleratorOutput{})
pulumi.RegisterOutputType(CustomRoutingAcceleratorArrayOutput{})
pulumi.RegisterOutputType(CustomRoutingAcceleratorMapOutput{})
}