/
hostedConnection.go
347 lines (301 loc) · 15.3 KB
/
hostedConnection.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
// *** 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! ***
package directconnect
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a hosted connection on the specified interconnect or a link aggregation group (LAG) of interconnects. Intended for use by AWS Direct Connect Partners only.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/directconnect"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := directconnect.NewHostedConnection(ctx, "hosted", &directconnect.HostedConnectionArgs{
// Bandwidth: pulumi.String("100Mbps"),
// ConnectionId: pulumi.String("dxcon-ffabc123"),
// OwnerAccountId: pulumi.String("123456789012"),
// Vlan: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type HostedConnection struct {
pulumi.CustomResourceState
// The Direct Connect endpoint on which the physical connection terminates.
AwsDevice pulumi.StringOutput `pulumi:"awsDevice"`
// The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps and 10Gbps. Case sensitive.
Bandwidth pulumi.StringOutput `pulumi:"bandwidth"`
// The ID of the interconnect or LAG.
ConnectionId pulumi.StringOutput `pulumi:"connectionId"`
// Indicates whether the connection supports a secondary BGP peer in the same address family (IPv4/IPv6).
HasLogicalRedundancy pulumi.StringOutput `pulumi:"hasLogicalRedundancy"`
// Boolean value representing if jumbo frames have been enabled for this connection.
JumboFrameCapable pulumi.BoolOutput `pulumi:"jumboFrameCapable"`
// The ID of the LAG.
LagId pulumi.StringOutput `pulumi:"lagId"`
// The time of the most recent call to [DescribeLoa](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLoa.html) for this connection.
LoaIssueTime pulumi.StringOutput `pulumi:"loaIssueTime"`
// The location of the connection.
Location pulumi.StringOutput `pulumi:"location"`
// The name of the connection.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the AWS account of the customer for the connection.
OwnerAccountId pulumi.StringOutput `pulumi:"ownerAccountId"`
// The name of the AWS Direct Connect service provider associated with the connection.
PartnerName pulumi.StringOutput `pulumi:"partnerName"`
// The name of the service provider associated with the connection.
ProviderName pulumi.StringOutput `pulumi:"providerName"`
// The AWS Region where the connection is located.
Region pulumi.StringOutput `pulumi:"region"`
// The state of the connection. Possible values include: ordering, requested, pending, available, down, deleting, deleted, rejected, unknown. See [AllocateHostedConnection](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_AllocateHostedConnection.html) for a description of each connection state.
State pulumi.StringOutput `pulumi:"state"`
// The dedicated VLAN provisioned to the hosted connection.
Vlan pulumi.IntOutput `pulumi:"vlan"`
}
// NewHostedConnection registers a new resource with the given unique name, arguments, and options.
func NewHostedConnection(ctx *pulumi.Context,
name string, args *HostedConnectionArgs, opts ...pulumi.ResourceOption) (*HostedConnection, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Bandwidth == nil {
return nil, errors.New("invalid value for required argument 'Bandwidth'")
}
if args.ConnectionId == nil {
return nil, errors.New("invalid value for required argument 'ConnectionId'")
}
if args.OwnerAccountId == nil {
return nil, errors.New("invalid value for required argument 'OwnerAccountId'")
}
if args.Vlan == nil {
return nil, errors.New("invalid value for required argument 'Vlan'")
}
var resource HostedConnection
err := ctx.RegisterResource("aws:directconnect/hostedConnection:HostedConnection", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHostedConnection gets an existing HostedConnection 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 GetHostedConnection(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostedConnectionState, opts ...pulumi.ResourceOption) (*HostedConnection, error) {
var resource HostedConnection
err := ctx.ReadResource("aws:directconnect/hostedConnection:HostedConnection", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HostedConnection resources.
type hostedConnectionState struct {
// The Direct Connect endpoint on which the physical connection terminates.
AwsDevice *string `pulumi:"awsDevice"`
// The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps and 10Gbps. Case sensitive.
Bandwidth *string `pulumi:"bandwidth"`
// The ID of the interconnect or LAG.
ConnectionId *string `pulumi:"connectionId"`
// Indicates whether the connection supports a secondary BGP peer in the same address family (IPv4/IPv6).
HasLogicalRedundancy *string `pulumi:"hasLogicalRedundancy"`
// Boolean value representing if jumbo frames have been enabled for this connection.
JumboFrameCapable *bool `pulumi:"jumboFrameCapable"`
// The ID of the LAG.
LagId *string `pulumi:"lagId"`
// The time of the most recent call to [DescribeLoa](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLoa.html) for this connection.
LoaIssueTime *string `pulumi:"loaIssueTime"`
// The location of the connection.
Location *string `pulumi:"location"`
// The name of the connection.
Name *string `pulumi:"name"`
// The ID of the AWS account of the customer for the connection.
OwnerAccountId *string `pulumi:"ownerAccountId"`
// The name of the AWS Direct Connect service provider associated with the connection.
PartnerName *string `pulumi:"partnerName"`
// The name of the service provider associated with the connection.
ProviderName *string `pulumi:"providerName"`
// The AWS Region where the connection is located.
Region *string `pulumi:"region"`
// The state of the connection. Possible values include: ordering, requested, pending, available, down, deleting, deleted, rejected, unknown. See [AllocateHostedConnection](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_AllocateHostedConnection.html) for a description of each connection state.
State *string `pulumi:"state"`
// The dedicated VLAN provisioned to the hosted connection.
Vlan *int `pulumi:"vlan"`
}
type HostedConnectionState struct {
// The Direct Connect endpoint on which the physical connection terminates.
AwsDevice pulumi.StringPtrInput
// The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps and 10Gbps. Case sensitive.
Bandwidth pulumi.StringPtrInput
// The ID of the interconnect or LAG.
ConnectionId pulumi.StringPtrInput
// Indicates whether the connection supports a secondary BGP peer in the same address family (IPv4/IPv6).
HasLogicalRedundancy pulumi.StringPtrInput
// Boolean value representing if jumbo frames have been enabled for this connection.
JumboFrameCapable pulumi.BoolPtrInput
// The ID of the LAG.
LagId pulumi.StringPtrInput
// The time of the most recent call to [DescribeLoa](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_DescribeLoa.html) for this connection.
LoaIssueTime pulumi.StringPtrInput
// The location of the connection.
Location pulumi.StringPtrInput
// The name of the connection.
Name pulumi.StringPtrInput
// The ID of the AWS account of the customer for the connection.
OwnerAccountId pulumi.StringPtrInput
// The name of the AWS Direct Connect service provider associated with the connection.
PartnerName pulumi.StringPtrInput
// The name of the service provider associated with the connection.
ProviderName pulumi.StringPtrInput
// The AWS Region where the connection is located.
Region pulumi.StringPtrInput
// The state of the connection. Possible values include: ordering, requested, pending, available, down, deleting, deleted, rejected, unknown. See [AllocateHostedConnection](https://docs.aws.amazon.com/directconnect/latest/APIReference/API_AllocateHostedConnection.html) for a description of each connection state.
State pulumi.StringPtrInput
// The dedicated VLAN provisioned to the hosted connection.
Vlan pulumi.IntPtrInput
}
func (HostedConnectionState) ElementType() reflect.Type {
return reflect.TypeOf((*hostedConnectionState)(nil)).Elem()
}
type hostedConnectionArgs struct {
// The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps and 10Gbps. Case sensitive.
Bandwidth string `pulumi:"bandwidth"`
// The ID of the interconnect or LAG.
ConnectionId string `pulumi:"connectionId"`
// The name of the connection.
Name *string `pulumi:"name"`
// The ID of the AWS account of the customer for the connection.
OwnerAccountId string `pulumi:"ownerAccountId"`
// The dedicated VLAN provisioned to the hosted connection.
Vlan int `pulumi:"vlan"`
}
// The set of arguments for constructing a HostedConnection resource.
type HostedConnectionArgs struct {
// The bandwidth of the connection. Valid values for dedicated connections: 1Gbps, 10Gbps. Valid values for hosted connections: 50Mbps, 100Mbps, 200Mbps, 300Mbps, 400Mbps, 500Mbps, 1Gbps, 2Gbps, 5Gbps and 10Gbps. Case sensitive.
Bandwidth pulumi.StringInput
// The ID of the interconnect or LAG.
ConnectionId pulumi.StringInput
// The name of the connection.
Name pulumi.StringPtrInput
// The ID of the AWS account of the customer for the connection.
OwnerAccountId pulumi.StringInput
// The dedicated VLAN provisioned to the hosted connection.
Vlan pulumi.IntInput
}
func (HostedConnectionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostedConnectionArgs)(nil)).Elem()
}
type HostedConnectionInput interface {
pulumi.Input
ToHostedConnectionOutput() HostedConnectionOutput
ToHostedConnectionOutputWithContext(ctx context.Context) HostedConnectionOutput
}
func (*HostedConnection) ElementType() reflect.Type {
return reflect.TypeOf((**HostedConnection)(nil)).Elem()
}
func (i *HostedConnection) ToHostedConnectionOutput() HostedConnectionOutput {
return i.ToHostedConnectionOutputWithContext(context.Background())
}
func (i *HostedConnection) ToHostedConnectionOutputWithContext(ctx context.Context) HostedConnectionOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedConnectionOutput)
}
// HostedConnectionArrayInput is an input type that accepts HostedConnectionArray and HostedConnectionArrayOutput values.
// You can construct a concrete instance of `HostedConnectionArrayInput` via:
//
// HostedConnectionArray{ HostedConnectionArgs{...} }
type HostedConnectionArrayInput interface {
pulumi.Input
ToHostedConnectionArrayOutput() HostedConnectionArrayOutput
ToHostedConnectionArrayOutputWithContext(context.Context) HostedConnectionArrayOutput
}
type HostedConnectionArray []HostedConnectionInput
func (HostedConnectionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedConnection)(nil)).Elem()
}
func (i HostedConnectionArray) ToHostedConnectionArrayOutput() HostedConnectionArrayOutput {
return i.ToHostedConnectionArrayOutputWithContext(context.Background())
}
func (i HostedConnectionArray) ToHostedConnectionArrayOutputWithContext(ctx context.Context) HostedConnectionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedConnectionArrayOutput)
}
// HostedConnectionMapInput is an input type that accepts HostedConnectionMap and HostedConnectionMapOutput values.
// You can construct a concrete instance of `HostedConnectionMapInput` via:
//
// HostedConnectionMap{ "key": HostedConnectionArgs{...} }
type HostedConnectionMapInput interface {
pulumi.Input
ToHostedConnectionMapOutput() HostedConnectionMapOutput
ToHostedConnectionMapOutputWithContext(context.Context) HostedConnectionMapOutput
}
type HostedConnectionMap map[string]HostedConnectionInput
func (HostedConnectionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedConnection)(nil)).Elem()
}
func (i HostedConnectionMap) ToHostedConnectionMapOutput() HostedConnectionMapOutput {
return i.ToHostedConnectionMapOutputWithContext(context.Background())
}
func (i HostedConnectionMap) ToHostedConnectionMapOutputWithContext(ctx context.Context) HostedConnectionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedConnectionMapOutput)
}
type HostedConnectionOutput struct{ *pulumi.OutputState }
func (HostedConnectionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HostedConnection)(nil)).Elem()
}
func (o HostedConnectionOutput) ToHostedConnectionOutput() HostedConnectionOutput {
return o
}
func (o HostedConnectionOutput) ToHostedConnectionOutputWithContext(ctx context.Context) HostedConnectionOutput {
return o
}
type HostedConnectionArrayOutput struct{ *pulumi.OutputState }
func (HostedConnectionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedConnection)(nil)).Elem()
}
func (o HostedConnectionArrayOutput) ToHostedConnectionArrayOutput() HostedConnectionArrayOutput {
return o
}
func (o HostedConnectionArrayOutput) ToHostedConnectionArrayOutputWithContext(ctx context.Context) HostedConnectionArrayOutput {
return o
}
func (o HostedConnectionArrayOutput) Index(i pulumi.IntInput) HostedConnectionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostedConnection {
return vs[0].([]*HostedConnection)[vs[1].(int)]
}).(HostedConnectionOutput)
}
type HostedConnectionMapOutput struct{ *pulumi.OutputState }
func (HostedConnectionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedConnection)(nil)).Elem()
}
func (o HostedConnectionMapOutput) ToHostedConnectionMapOutput() HostedConnectionMapOutput {
return o
}
func (o HostedConnectionMapOutput) ToHostedConnectionMapOutputWithContext(ctx context.Context) HostedConnectionMapOutput {
return o
}
func (o HostedConnectionMapOutput) MapIndex(k pulumi.StringInput) HostedConnectionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostedConnection {
return vs[0].(map[string]*HostedConnection)[vs[1].(string)]
}).(HostedConnectionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostedConnectionInput)(nil)).Elem(), &HostedConnection{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedConnectionArrayInput)(nil)).Elem(), HostedConnectionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedConnectionMapInput)(nil)).Elem(), HostedConnectionMap{})
pulumi.RegisterOutputType(HostedConnectionOutput{})
pulumi.RegisterOutputType(HostedConnectionArrayOutput{})
pulumi.RegisterOutputType(HostedConnectionMapOutput{})
}