/
hostedPrivateVirtualInterfaceAccepter.go
351 lines (299 loc) · 17.2 KB
/
hostedPrivateVirtualInterfaceAccepter.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
// 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 directconnect
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to manage the accepter's side of a Direct Connect hosted private virtual interface.
// This resource accepts ownership of a private virtual interface created by another AWS account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/directconnect"
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aws.NewProvider(ctx, "accepter", nil)
// if err != nil {
// return err
// }
// accepterCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)
// if err != nil {
// return err
// }
// vpnGw, err := ec2.NewVpnGateway(ctx, "vpnGw", nil, pulumi.Provider(aws.Accepter))
// if err != nil {
// return err
// }
// creator, err := directconnect.NewHostedPrivateVirtualInterface(ctx, "creator", &directconnect.HostedPrivateVirtualInterfaceArgs{
// ConnectionId: pulumi.String("dxcon-zzzzzzzz"),
// OwnerAccountId: *pulumi.String(accepterCallerIdentity.AccountId),
// Vlan: pulumi.Int(4094),
// AddressFamily: pulumi.String("ipv4"),
// BgpAsn: pulumi.Int(65352),
// }, pulumi.DependsOn([]pulumi.Resource{
// vpnGw,
// }))
// if err != nil {
// return err
// }
// _, err = directconnect.NewHostedPrivateVirtualInterfaceAccepter(ctx, "accepterHostedPrivateVirtualInterfaceAccepter", &directconnect.HostedPrivateVirtualInterfaceAccepterArgs{
// VirtualInterfaceId: creator.ID(),
// VpnGatewayId: vpnGw.ID(),
// Tags: pulumi.StringMap{
// "Side": pulumi.String("Accepter"),
// },
// }, pulumi.Provider(aws.Accepter))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Direct Connect hosted private virtual interfaces can be imported using the `vif id`, e.g.,
//
// ```sh
//
// $ pulumi import aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter test dxvif-33cc44dd
//
// ```
type HostedPrivateVirtualInterfaceAccepter struct {
pulumi.CustomResourceState
// The ARN of the virtual interface.
Arn pulumi.StringOutput `pulumi:"arn"`
// The ID of the Direct Connect gateway to which to connect the virtual interface.
DxGatewayId pulumi.StringPtrOutput `pulumi:"dxGatewayId"`
// 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.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId pulumi.StringOutput `pulumi:"virtualInterfaceId"`
// The ID of the virtual private gateway to which to connect the virtual interface.
VpnGatewayId pulumi.StringPtrOutput `pulumi:"vpnGatewayId"`
}
// NewHostedPrivateVirtualInterfaceAccepter registers a new resource with the given unique name, arguments, and options.
func NewHostedPrivateVirtualInterfaceAccepter(ctx *pulumi.Context,
name string, args *HostedPrivateVirtualInterfaceAccepterArgs, opts ...pulumi.ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VirtualInterfaceId == nil {
return nil, errors.New("invalid value for required argument 'VirtualInterfaceId'")
}
var resource HostedPrivateVirtualInterfaceAccepter
err := ctx.RegisterResource("aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHostedPrivateVirtualInterfaceAccepter gets an existing HostedPrivateVirtualInterfaceAccepter 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 GetHostedPrivateVirtualInterfaceAccepter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostedPrivateVirtualInterfaceAccepterState, opts ...pulumi.ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error) {
var resource HostedPrivateVirtualInterfaceAccepter
err := ctx.ReadResource("aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HostedPrivateVirtualInterfaceAccepter resources.
type hostedPrivateVirtualInterfaceAccepterState struct {
// The ARN of the virtual interface.
Arn *string `pulumi:"arn"`
// The ID of the Direct Connect gateway to which to connect the virtual interface.
DxGatewayId *string `pulumi:"dxGatewayId"`
// 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.
TagsAll map[string]string `pulumi:"tagsAll"`
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId *string `pulumi:"virtualInterfaceId"`
// The ID of the virtual private gateway to which to connect the virtual interface.
VpnGatewayId *string `pulumi:"vpnGatewayId"`
}
type HostedPrivateVirtualInterfaceAccepterState struct {
// The ARN of the virtual interface.
Arn pulumi.StringPtrInput
// The ID of the Direct Connect gateway to which to connect the virtual interface.
DxGatewayId 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.
TagsAll pulumi.StringMapInput
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId pulumi.StringPtrInput
// The ID of the virtual private gateway to which to connect the virtual interface.
VpnGatewayId pulumi.StringPtrInput
}
func (HostedPrivateVirtualInterfaceAccepterState) ElementType() reflect.Type {
return reflect.TypeOf((*hostedPrivateVirtualInterfaceAccepterState)(nil)).Elem()
}
type hostedPrivateVirtualInterfaceAccepterArgs struct {
// The ID of the Direct Connect gateway to which to connect the virtual interface.
DxGatewayId *string `pulumi:"dxGatewayId"`
// 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 ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId string `pulumi:"virtualInterfaceId"`
// The ID of the virtual private gateway to which to connect the virtual interface.
VpnGatewayId *string `pulumi:"vpnGatewayId"`
}
// The set of arguments for constructing a HostedPrivateVirtualInterfaceAccepter resource.
type HostedPrivateVirtualInterfaceAccepterArgs struct {
// The ID of the Direct Connect gateway to which to connect the virtual interface.
DxGatewayId 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
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId pulumi.StringInput
// The ID of the virtual private gateway to which to connect the virtual interface.
VpnGatewayId pulumi.StringPtrInput
}
func (HostedPrivateVirtualInterfaceAccepterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostedPrivateVirtualInterfaceAccepterArgs)(nil)).Elem()
}
type HostedPrivateVirtualInterfaceAccepterInput interface {
pulumi.Input
ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput
ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput
}
func (*HostedPrivateVirtualInterfaceAccepter) ElementType() reflect.Type {
return reflect.TypeOf((**HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (i *HostedPrivateVirtualInterfaceAccepter) ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput {
return i.ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(context.Background())
}
func (i *HostedPrivateVirtualInterfaceAccepter) ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterOutput)
}
// HostedPrivateVirtualInterfaceAccepterArrayInput is an input type that accepts HostedPrivateVirtualInterfaceAccepterArray and HostedPrivateVirtualInterfaceAccepterArrayOutput values.
// You can construct a concrete instance of `HostedPrivateVirtualInterfaceAccepterArrayInput` via:
//
// HostedPrivateVirtualInterfaceAccepterArray{ HostedPrivateVirtualInterfaceAccepterArgs{...} }
type HostedPrivateVirtualInterfaceAccepterArrayInput interface {
pulumi.Input
ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput
ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput
}
type HostedPrivateVirtualInterfaceAccepterArray []HostedPrivateVirtualInterfaceAccepterInput
func (HostedPrivateVirtualInterfaceAccepterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (i HostedPrivateVirtualInterfaceAccepterArray) ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput {
return i.ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(context.Background())
}
func (i HostedPrivateVirtualInterfaceAccepterArray) ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterArrayOutput)
}
// HostedPrivateVirtualInterfaceAccepterMapInput is an input type that accepts HostedPrivateVirtualInterfaceAccepterMap and HostedPrivateVirtualInterfaceAccepterMapOutput values.
// You can construct a concrete instance of `HostedPrivateVirtualInterfaceAccepterMapInput` via:
//
// HostedPrivateVirtualInterfaceAccepterMap{ "key": HostedPrivateVirtualInterfaceAccepterArgs{...} }
type HostedPrivateVirtualInterfaceAccepterMapInput interface {
pulumi.Input
ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput
ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput
}
type HostedPrivateVirtualInterfaceAccepterMap map[string]HostedPrivateVirtualInterfaceAccepterInput
func (HostedPrivateVirtualInterfaceAccepterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (i HostedPrivateVirtualInterfaceAccepterMap) ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput {
return i.ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(context.Background())
}
func (i HostedPrivateVirtualInterfaceAccepterMap) ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterMapOutput)
}
type HostedPrivateVirtualInterfaceAccepterOutput struct{ *pulumi.OutputState }
func (HostedPrivateVirtualInterfaceAccepterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPrivateVirtualInterfaceAccepterOutput) ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput {
return o
}
func (o HostedPrivateVirtualInterfaceAccepterOutput) ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput {
return o
}
// The ARN of the virtual interface.
func (o HostedPrivateVirtualInterfaceAccepterOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The ID of the Direct Connect gateway to which to connect the virtual interface.
func (o HostedPrivateVirtualInterfaceAccepterOutput) DxGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringPtrOutput { return v.DxGatewayId }).(pulumi.StringPtrOutput)
}
// 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 HostedPrivateVirtualInterfaceAccepterOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
func (o HostedPrivateVirtualInterfaceAccepterOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// The ID of the Direct Connect virtual interface to accept.
func (o HostedPrivateVirtualInterfaceAccepterOutput) VirtualInterfaceId() pulumi.StringOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringOutput { return v.VirtualInterfaceId }).(pulumi.StringOutput)
}
// The ID of the virtual private gateway to which to connect the virtual interface.
func (o HostedPrivateVirtualInterfaceAccepterOutput) VpnGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringPtrOutput { return v.VpnGatewayId }).(pulumi.StringPtrOutput)
}
type HostedPrivateVirtualInterfaceAccepterArrayOutput struct{ *pulumi.OutputState }
func (HostedPrivateVirtualInterfaceAccepterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput {
return o
}
func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput {
return o
}
func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) Index(i pulumi.IntInput) HostedPrivateVirtualInterfaceAccepterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostedPrivateVirtualInterfaceAccepter {
return vs[0].([]*HostedPrivateVirtualInterfaceAccepter)[vs[1].(int)]
}).(HostedPrivateVirtualInterfaceAccepterOutput)
}
type HostedPrivateVirtualInterfaceAccepterMapOutput struct{ *pulumi.OutputState }
func (HostedPrivateVirtualInterfaceAccepterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPrivateVirtualInterfaceAccepterMapOutput) ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput {
return o
}
func (o HostedPrivateVirtualInterfaceAccepterMapOutput) ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput {
return o
}
func (o HostedPrivateVirtualInterfaceAccepterMapOutput) MapIndex(k pulumi.StringInput) HostedPrivateVirtualInterfaceAccepterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostedPrivateVirtualInterfaceAccepter {
return vs[0].(map[string]*HostedPrivateVirtualInterfaceAccepter)[vs[1].(string)]
}).(HostedPrivateVirtualInterfaceAccepterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterInput)(nil)).Elem(), &HostedPrivateVirtualInterfaceAccepter{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterArrayInput)(nil)).Elem(), HostedPrivateVirtualInterfaceAccepterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterMapInput)(nil)).Elem(), HostedPrivateVirtualInterfaceAccepterMap{})
pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterOutput{})
pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterArrayOutput{})
pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterMapOutput{})
}