generated from pulumi/pulumi-tf-provider-boilerplate
/
aviatrixAwsTgwDirectconnect.go
369 lines (316 loc) · 17.2 KB
/
aviatrixAwsTgwDirectconnect.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
// 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 aviatrix
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The **aviatrix_aws_tgw_directconnect** resource allows the creation and management of Aviatrix-created AWS TGW DirectConnect connections.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/astipkovits/pulumi-aviatrix/sdk/go/aviatrix"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aviatrix.NewAviatrixAwsTgwDirectconnect(ctx, "testAwsTgwDirectconnect", &aviatrix.AviatrixAwsTgwDirectconnectArgs{
// AllowedPrefix: pulumi.String("10.12.0.0/24"),
// DirectconnectAccountName: pulumi.String("username"),
// DxGatewayId: pulumi.String("30321d76-dd01-49bf"),
// NetworkDomainName: pulumi.String("my-ndn-1"),
// TgwName: pulumi.String("my-aws-tgw-1"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// **aws_tgw_directconnect** can be imported using the `tgw_name` and `dx_gateway_id`, e.g.
//
// ```sh
//
// $ pulumi import aviatrix:index/aviatrixAwsTgwDirectconnect:AviatrixAwsTgwDirectconnect test tgw_name~dx_gateway_id
//
// ```
type AviatrixAwsTgwDirectconnect struct {
pulumi.CustomResourceState
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
AllowedPrefix pulumi.StringOutput `pulumi:"allowedPrefix"`
// This parameter represents the name of an Account in Aviatrix controller.
DirectconnectAccountName pulumi.StringOutput `pulumi:"directconnectAccountName"`
// This parameter represents the name of a Direct Connect Gateway ID.
DxGatewayId pulumi.StringOutput `pulumi:"dxGatewayId"`
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
EnableLearnedCidrsApproval pulumi.BoolPtrOutput `pulumi:"enableLearnedCidrsApproval"`
// The name of a network domain, to which the direct connect gateway will be attached.
NetworkDomainName pulumi.StringPtrOutput `pulumi:"networkDomainName"`
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
SecurityDomainName pulumi.StringPtrOutput `pulumi:"securityDomainName"`
// This parameter represents the name of an AWS TGW.
TgwName pulumi.StringOutput `pulumi:"tgwName"`
}
// NewAviatrixAwsTgwDirectconnect registers a new resource with the given unique name, arguments, and options.
func NewAviatrixAwsTgwDirectconnect(ctx *pulumi.Context,
name string, args *AviatrixAwsTgwDirectconnectArgs, opts ...pulumi.ResourceOption) (*AviatrixAwsTgwDirectconnect, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AllowedPrefix == nil {
return nil, errors.New("invalid value for required argument 'AllowedPrefix'")
}
if args.DirectconnectAccountName == nil {
return nil, errors.New("invalid value for required argument 'DirectconnectAccountName'")
}
if args.DxGatewayId == nil {
return nil, errors.New("invalid value for required argument 'DxGatewayId'")
}
if args.TgwName == nil {
return nil, errors.New("invalid value for required argument 'TgwName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource AviatrixAwsTgwDirectconnect
err := ctx.RegisterResource("aviatrix:index/aviatrixAwsTgwDirectconnect:AviatrixAwsTgwDirectconnect", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAviatrixAwsTgwDirectconnect gets an existing AviatrixAwsTgwDirectconnect 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 GetAviatrixAwsTgwDirectconnect(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AviatrixAwsTgwDirectconnectState, opts ...pulumi.ResourceOption) (*AviatrixAwsTgwDirectconnect, error) {
var resource AviatrixAwsTgwDirectconnect
err := ctx.ReadResource("aviatrix:index/aviatrixAwsTgwDirectconnect:AviatrixAwsTgwDirectconnect", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AviatrixAwsTgwDirectconnect resources.
type aviatrixAwsTgwDirectconnectState struct {
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
AllowedPrefix *string `pulumi:"allowedPrefix"`
// This parameter represents the name of an Account in Aviatrix controller.
DirectconnectAccountName *string `pulumi:"directconnectAccountName"`
// This parameter represents the name of a Direct Connect Gateway ID.
DxGatewayId *string `pulumi:"dxGatewayId"`
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
EnableLearnedCidrsApproval *bool `pulumi:"enableLearnedCidrsApproval"`
// The name of a network domain, to which the direct connect gateway will be attached.
NetworkDomainName *string `pulumi:"networkDomainName"`
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
SecurityDomainName *string `pulumi:"securityDomainName"`
// This parameter represents the name of an AWS TGW.
TgwName *string `pulumi:"tgwName"`
}
type AviatrixAwsTgwDirectconnectState struct {
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
AllowedPrefix pulumi.StringPtrInput
// This parameter represents the name of an Account in Aviatrix controller.
DirectconnectAccountName pulumi.StringPtrInput
// This parameter represents the name of a Direct Connect Gateway ID.
DxGatewayId pulumi.StringPtrInput
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
EnableLearnedCidrsApproval pulumi.BoolPtrInput
// The name of a network domain, to which the direct connect gateway will be attached.
NetworkDomainName pulumi.StringPtrInput
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
SecurityDomainName pulumi.StringPtrInput
// This parameter represents the name of an AWS TGW.
TgwName pulumi.StringPtrInput
}
func (AviatrixAwsTgwDirectconnectState) ElementType() reflect.Type {
return reflect.TypeOf((*aviatrixAwsTgwDirectconnectState)(nil)).Elem()
}
type aviatrixAwsTgwDirectconnectArgs struct {
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
AllowedPrefix string `pulumi:"allowedPrefix"`
// This parameter represents the name of an Account in Aviatrix controller.
DirectconnectAccountName string `pulumi:"directconnectAccountName"`
// This parameter represents the name of a Direct Connect Gateway ID.
DxGatewayId string `pulumi:"dxGatewayId"`
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
EnableLearnedCidrsApproval *bool `pulumi:"enableLearnedCidrsApproval"`
// The name of a network domain, to which the direct connect gateway will be attached.
NetworkDomainName *string `pulumi:"networkDomainName"`
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
SecurityDomainName *string `pulumi:"securityDomainName"`
// This parameter represents the name of an AWS TGW.
TgwName string `pulumi:"tgwName"`
}
// The set of arguments for constructing a AviatrixAwsTgwDirectconnect resource.
type AviatrixAwsTgwDirectconnectArgs struct {
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
AllowedPrefix pulumi.StringInput
// This parameter represents the name of an Account in Aviatrix controller.
DirectconnectAccountName pulumi.StringInput
// This parameter represents the name of a Direct Connect Gateway ID.
DxGatewayId pulumi.StringInput
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
EnableLearnedCidrsApproval pulumi.BoolPtrInput
// The name of a network domain, to which the direct connect gateway will be attached.
NetworkDomainName pulumi.StringPtrInput
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
SecurityDomainName pulumi.StringPtrInput
// This parameter represents the name of an AWS TGW.
TgwName pulumi.StringInput
}
func (AviatrixAwsTgwDirectconnectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*aviatrixAwsTgwDirectconnectArgs)(nil)).Elem()
}
type AviatrixAwsTgwDirectconnectInput interface {
pulumi.Input
ToAviatrixAwsTgwDirectconnectOutput() AviatrixAwsTgwDirectconnectOutput
ToAviatrixAwsTgwDirectconnectOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectOutput
}
func (*AviatrixAwsTgwDirectconnect) ElementType() reflect.Type {
return reflect.TypeOf((**AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (i *AviatrixAwsTgwDirectconnect) ToAviatrixAwsTgwDirectconnectOutput() AviatrixAwsTgwDirectconnectOutput {
return i.ToAviatrixAwsTgwDirectconnectOutputWithContext(context.Background())
}
func (i *AviatrixAwsTgwDirectconnect) ToAviatrixAwsTgwDirectconnectOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectOutput {
return pulumi.ToOutputWithContext(ctx, i).(AviatrixAwsTgwDirectconnectOutput)
}
// AviatrixAwsTgwDirectconnectArrayInput is an input type that accepts AviatrixAwsTgwDirectconnectArray and AviatrixAwsTgwDirectconnectArrayOutput values.
// You can construct a concrete instance of `AviatrixAwsTgwDirectconnectArrayInput` via:
//
// AviatrixAwsTgwDirectconnectArray{ AviatrixAwsTgwDirectconnectArgs{...} }
type AviatrixAwsTgwDirectconnectArrayInput interface {
pulumi.Input
ToAviatrixAwsTgwDirectconnectArrayOutput() AviatrixAwsTgwDirectconnectArrayOutput
ToAviatrixAwsTgwDirectconnectArrayOutputWithContext(context.Context) AviatrixAwsTgwDirectconnectArrayOutput
}
type AviatrixAwsTgwDirectconnectArray []AviatrixAwsTgwDirectconnectInput
func (AviatrixAwsTgwDirectconnectArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (i AviatrixAwsTgwDirectconnectArray) ToAviatrixAwsTgwDirectconnectArrayOutput() AviatrixAwsTgwDirectconnectArrayOutput {
return i.ToAviatrixAwsTgwDirectconnectArrayOutputWithContext(context.Background())
}
func (i AviatrixAwsTgwDirectconnectArray) ToAviatrixAwsTgwDirectconnectArrayOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AviatrixAwsTgwDirectconnectArrayOutput)
}
// AviatrixAwsTgwDirectconnectMapInput is an input type that accepts AviatrixAwsTgwDirectconnectMap and AviatrixAwsTgwDirectconnectMapOutput values.
// You can construct a concrete instance of `AviatrixAwsTgwDirectconnectMapInput` via:
//
// AviatrixAwsTgwDirectconnectMap{ "key": AviatrixAwsTgwDirectconnectArgs{...} }
type AviatrixAwsTgwDirectconnectMapInput interface {
pulumi.Input
ToAviatrixAwsTgwDirectconnectMapOutput() AviatrixAwsTgwDirectconnectMapOutput
ToAviatrixAwsTgwDirectconnectMapOutputWithContext(context.Context) AviatrixAwsTgwDirectconnectMapOutput
}
type AviatrixAwsTgwDirectconnectMap map[string]AviatrixAwsTgwDirectconnectInput
func (AviatrixAwsTgwDirectconnectMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (i AviatrixAwsTgwDirectconnectMap) ToAviatrixAwsTgwDirectconnectMapOutput() AviatrixAwsTgwDirectconnectMapOutput {
return i.ToAviatrixAwsTgwDirectconnectMapOutputWithContext(context.Background())
}
func (i AviatrixAwsTgwDirectconnectMap) ToAviatrixAwsTgwDirectconnectMapOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AviatrixAwsTgwDirectconnectMapOutput)
}
type AviatrixAwsTgwDirectconnectOutput struct{ *pulumi.OutputState }
func (AviatrixAwsTgwDirectconnectOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (o AviatrixAwsTgwDirectconnectOutput) ToAviatrixAwsTgwDirectconnectOutput() AviatrixAwsTgwDirectconnectOutput {
return o
}
func (o AviatrixAwsTgwDirectconnectOutput) ToAviatrixAwsTgwDirectconnectOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectOutput {
return o
}
// A list of comma separated CIDRs for DXGW to advertise to remote(on-prem).
func (o AviatrixAwsTgwDirectconnectOutput) AllowedPrefix() pulumi.StringOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringOutput { return v.AllowedPrefix }).(pulumi.StringOutput)
}
// This parameter represents the name of an Account in Aviatrix controller.
func (o AviatrixAwsTgwDirectconnectOutput) DirectconnectAccountName() pulumi.StringOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringOutput { return v.DirectconnectAccountName }).(pulumi.StringOutput)
}
// This parameter represents the name of a Direct Connect Gateway ID.
func (o AviatrixAwsTgwDirectconnectOutput) DxGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringOutput { return v.DxGatewayId }).(pulumi.StringOutput)
}
// Switch to enable/disable [encrypted transit approval](https://docs.aviatrix.com/HowTos/tgw_approval.html) for AWS TGW DirectConnect. Valid values: true, false. Default value: false.
func (o AviatrixAwsTgwDirectconnectOutput) EnableLearnedCidrsApproval() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.BoolPtrOutput { return v.EnableLearnedCidrsApproval }).(pulumi.BoolPtrOutput)
}
// The name of a network domain, to which the direct connect gateway will be attached.
func (o AviatrixAwsTgwDirectconnectOutput) NetworkDomainName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringPtrOutput { return v.NetworkDomainName }).(pulumi.StringPtrOutput)
}
// The name of a security domain, to which the direct connect gateway will be attached.
//
// Deprecated: Please use network_domain_name instead.
func (o AviatrixAwsTgwDirectconnectOutput) SecurityDomainName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringPtrOutput { return v.SecurityDomainName }).(pulumi.StringPtrOutput)
}
// This parameter represents the name of an AWS TGW.
func (o AviatrixAwsTgwDirectconnectOutput) TgwName() pulumi.StringOutput {
return o.ApplyT(func(v *AviatrixAwsTgwDirectconnect) pulumi.StringOutput { return v.TgwName }).(pulumi.StringOutput)
}
type AviatrixAwsTgwDirectconnectArrayOutput struct{ *pulumi.OutputState }
func (AviatrixAwsTgwDirectconnectArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (o AviatrixAwsTgwDirectconnectArrayOutput) ToAviatrixAwsTgwDirectconnectArrayOutput() AviatrixAwsTgwDirectconnectArrayOutput {
return o
}
func (o AviatrixAwsTgwDirectconnectArrayOutput) ToAviatrixAwsTgwDirectconnectArrayOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectArrayOutput {
return o
}
func (o AviatrixAwsTgwDirectconnectArrayOutput) Index(i pulumi.IntInput) AviatrixAwsTgwDirectconnectOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AviatrixAwsTgwDirectconnect {
return vs[0].([]*AviatrixAwsTgwDirectconnect)[vs[1].(int)]
}).(AviatrixAwsTgwDirectconnectOutput)
}
type AviatrixAwsTgwDirectconnectMapOutput struct{ *pulumi.OutputState }
func (AviatrixAwsTgwDirectconnectMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AviatrixAwsTgwDirectconnect)(nil)).Elem()
}
func (o AviatrixAwsTgwDirectconnectMapOutput) ToAviatrixAwsTgwDirectconnectMapOutput() AviatrixAwsTgwDirectconnectMapOutput {
return o
}
func (o AviatrixAwsTgwDirectconnectMapOutput) ToAviatrixAwsTgwDirectconnectMapOutputWithContext(ctx context.Context) AviatrixAwsTgwDirectconnectMapOutput {
return o
}
func (o AviatrixAwsTgwDirectconnectMapOutput) MapIndex(k pulumi.StringInput) AviatrixAwsTgwDirectconnectOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AviatrixAwsTgwDirectconnect {
return vs[0].(map[string]*AviatrixAwsTgwDirectconnect)[vs[1].(string)]
}).(AviatrixAwsTgwDirectconnectOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AviatrixAwsTgwDirectconnectInput)(nil)).Elem(), &AviatrixAwsTgwDirectconnect{})
pulumi.RegisterInputType(reflect.TypeOf((*AviatrixAwsTgwDirectconnectArrayInput)(nil)).Elem(), AviatrixAwsTgwDirectconnectArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AviatrixAwsTgwDirectconnectMapInput)(nil)).Elem(), AviatrixAwsTgwDirectconnectMap{})
pulumi.RegisterOutputType(AviatrixAwsTgwDirectconnectOutput{})
pulumi.RegisterOutputType(AviatrixAwsTgwDirectconnectArrayOutput{})
pulumi.RegisterOutputType(AviatrixAwsTgwDirectconnectMapOutput{})
}