/
hostedPublicVirtualInterfaceAccepter.go
295 lines (249 loc) · 13.9 KB
/
hostedPublicVirtualInterfaceAccepter.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
// *** 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 resource to manage the accepter's side of a Direct Connect hosted public virtual interface.
// This resource accepts ownership of a public virtual interface created by another AWS account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/directconnect"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/providers"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := providers.Newaws(ctx, "accepter", nil)
// if err != nil {
// return err
// }
// accepterCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)
// if err != nil {
// return err
// }
// creator, err := directconnect.NewHostedPublicVirtualInterface(ctx, "creator", &directconnect.HostedPublicVirtualInterfaceArgs{
// ConnectionId: pulumi.String("dxcon-zzzzzzzz"),
// OwnerAccountId: pulumi.String(accepterCallerIdentity.AccountId),
// Vlan: pulumi.Int(4094),
// AddressFamily: pulumi.String("ipv4"),
// BgpAsn: pulumi.Int(65352),
// CustomerAddress: pulumi.String("175.45.176.1/30"),
// AmazonAddress: pulumi.String("175.45.176.2/30"),
// RouteFilterPrefixes: pulumi.StringArray{
// pulumi.String("210.52.109.0/24"),
// pulumi.String("175.45.176.0/22"),
// },
// })
// if err != nil {
// return err
// }
// _, err = directconnect.NewHostedPublicVirtualInterfaceAccepter(ctx, "accepterHostedPublicVirtualInterfaceAccepter", &directconnect.HostedPublicVirtualInterfaceAccepterArgs{
// VirtualInterfaceId: creator.ID(),
// Tags: pulumi.StringMap{
// "Side": pulumi.String("Accepter"),
// },
// }, pulumi.Provider(aws.Accepter))
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Direct Connect hosted public virtual interfaces can be imported using the `vif id`, e.g.,
//
// ```sh
// $ pulumi import aws:directconnect/hostedPublicVirtualInterfaceAccepter:HostedPublicVirtualInterfaceAccepter test dxvif-33cc44dd
// ```
type HostedPublicVirtualInterfaceAccepter struct {
pulumi.CustomResourceState
// The ARN of the virtual interface.
Arn pulumi.StringOutput `pulumi:"arn"`
// 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 .
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId pulumi.StringOutput `pulumi:"virtualInterfaceId"`
}
// NewHostedPublicVirtualInterfaceAccepter registers a new resource with the given unique name, arguments, and options.
func NewHostedPublicVirtualInterfaceAccepter(ctx *pulumi.Context,
name string, args *HostedPublicVirtualInterfaceAccepterArgs, opts ...pulumi.ResourceOption) (*HostedPublicVirtualInterfaceAccepter, 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 HostedPublicVirtualInterfaceAccepter
err := ctx.RegisterResource("aws:directconnect/hostedPublicVirtualInterfaceAccepter:HostedPublicVirtualInterfaceAccepter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHostedPublicVirtualInterfaceAccepter gets an existing HostedPublicVirtualInterfaceAccepter 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 GetHostedPublicVirtualInterfaceAccepter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostedPublicVirtualInterfaceAccepterState, opts ...pulumi.ResourceOption) (*HostedPublicVirtualInterfaceAccepter, error) {
var resource HostedPublicVirtualInterfaceAccepter
err := ctx.ReadResource("aws:directconnect/hostedPublicVirtualInterfaceAccepter:HostedPublicVirtualInterfaceAccepter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HostedPublicVirtualInterfaceAccepter resources.
type hostedPublicVirtualInterfaceAccepterState struct {
// The ARN of the virtual interface.
Arn *string `pulumi:"arn"`
// 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 .
TagsAll map[string]string `pulumi:"tagsAll"`
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId *string `pulumi:"virtualInterfaceId"`
}
type HostedPublicVirtualInterfaceAccepterState struct {
// The ARN of the virtual interface.
Arn 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 .
TagsAll pulumi.StringMapInput
// The ID of the Direct Connect virtual interface to accept.
VirtualInterfaceId pulumi.StringPtrInput
}
func (HostedPublicVirtualInterfaceAccepterState) ElementType() reflect.Type {
return reflect.TypeOf((*hostedPublicVirtualInterfaceAccepterState)(nil)).Elem()
}
type hostedPublicVirtualInterfaceAccepterArgs struct {
// 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 set of arguments for constructing a HostedPublicVirtualInterfaceAccepter resource.
type HostedPublicVirtualInterfaceAccepterArgs struct {
// 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
}
func (HostedPublicVirtualInterfaceAccepterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostedPublicVirtualInterfaceAccepterArgs)(nil)).Elem()
}
type HostedPublicVirtualInterfaceAccepterInput interface {
pulumi.Input
ToHostedPublicVirtualInterfaceAccepterOutput() HostedPublicVirtualInterfaceAccepterOutput
ToHostedPublicVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterOutput
}
func (*HostedPublicVirtualInterfaceAccepter) ElementType() reflect.Type {
return reflect.TypeOf((**HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (i *HostedPublicVirtualInterfaceAccepter) ToHostedPublicVirtualInterfaceAccepterOutput() HostedPublicVirtualInterfaceAccepterOutput {
return i.ToHostedPublicVirtualInterfaceAccepterOutputWithContext(context.Background())
}
func (i *HostedPublicVirtualInterfaceAccepter) ToHostedPublicVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPublicVirtualInterfaceAccepterOutput)
}
// HostedPublicVirtualInterfaceAccepterArrayInput is an input type that accepts HostedPublicVirtualInterfaceAccepterArray and HostedPublicVirtualInterfaceAccepterArrayOutput values.
// You can construct a concrete instance of `HostedPublicVirtualInterfaceAccepterArrayInput` via:
//
// HostedPublicVirtualInterfaceAccepterArray{ HostedPublicVirtualInterfaceAccepterArgs{...} }
type HostedPublicVirtualInterfaceAccepterArrayInput interface {
pulumi.Input
ToHostedPublicVirtualInterfaceAccepterArrayOutput() HostedPublicVirtualInterfaceAccepterArrayOutput
ToHostedPublicVirtualInterfaceAccepterArrayOutputWithContext(context.Context) HostedPublicVirtualInterfaceAccepterArrayOutput
}
type HostedPublicVirtualInterfaceAccepterArray []HostedPublicVirtualInterfaceAccepterInput
func (HostedPublicVirtualInterfaceAccepterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (i HostedPublicVirtualInterfaceAccepterArray) ToHostedPublicVirtualInterfaceAccepterArrayOutput() HostedPublicVirtualInterfaceAccepterArrayOutput {
return i.ToHostedPublicVirtualInterfaceAccepterArrayOutputWithContext(context.Background())
}
func (i HostedPublicVirtualInterfaceAccepterArray) ToHostedPublicVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPublicVirtualInterfaceAccepterArrayOutput)
}
// HostedPublicVirtualInterfaceAccepterMapInput is an input type that accepts HostedPublicVirtualInterfaceAccepterMap and HostedPublicVirtualInterfaceAccepterMapOutput values.
// You can construct a concrete instance of `HostedPublicVirtualInterfaceAccepterMapInput` via:
//
// HostedPublicVirtualInterfaceAccepterMap{ "key": HostedPublicVirtualInterfaceAccepterArgs{...} }
type HostedPublicVirtualInterfaceAccepterMapInput interface {
pulumi.Input
ToHostedPublicVirtualInterfaceAccepterMapOutput() HostedPublicVirtualInterfaceAccepterMapOutput
ToHostedPublicVirtualInterfaceAccepterMapOutputWithContext(context.Context) HostedPublicVirtualInterfaceAccepterMapOutput
}
type HostedPublicVirtualInterfaceAccepterMap map[string]HostedPublicVirtualInterfaceAccepterInput
func (HostedPublicVirtualInterfaceAccepterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (i HostedPublicVirtualInterfaceAccepterMap) ToHostedPublicVirtualInterfaceAccepterMapOutput() HostedPublicVirtualInterfaceAccepterMapOutput {
return i.ToHostedPublicVirtualInterfaceAccepterMapOutputWithContext(context.Background())
}
func (i HostedPublicVirtualInterfaceAccepterMap) ToHostedPublicVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostedPublicVirtualInterfaceAccepterMapOutput)
}
type HostedPublicVirtualInterfaceAccepterOutput struct{ *pulumi.OutputState }
func (HostedPublicVirtualInterfaceAccepterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPublicVirtualInterfaceAccepterOutput) ToHostedPublicVirtualInterfaceAccepterOutput() HostedPublicVirtualInterfaceAccepterOutput {
return o
}
func (o HostedPublicVirtualInterfaceAccepterOutput) ToHostedPublicVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterOutput {
return o
}
type HostedPublicVirtualInterfaceAccepterArrayOutput struct{ *pulumi.OutputState }
func (HostedPublicVirtualInterfaceAccepterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPublicVirtualInterfaceAccepterArrayOutput) ToHostedPublicVirtualInterfaceAccepterArrayOutput() HostedPublicVirtualInterfaceAccepterArrayOutput {
return o
}
func (o HostedPublicVirtualInterfaceAccepterArrayOutput) ToHostedPublicVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterArrayOutput {
return o
}
func (o HostedPublicVirtualInterfaceAccepterArrayOutput) Index(i pulumi.IntInput) HostedPublicVirtualInterfaceAccepterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostedPublicVirtualInterfaceAccepter {
return vs[0].([]*HostedPublicVirtualInterfaceAccepter)[vs[1].(int)]
}).(HostedPublicVirtualInterfaceAccepterOutput)
}
type HostedPublicVirtualInterfaceAccepterMapOutput struct{ *pulumi.OutputState }
func (HostedPublicVirtualInterfaceAccepterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HostedPublicVirtualInterfaceAccepter)(nil)).Elem()
}
func (o HostedPublicVirtualInterfaceAccepterMapOutput) ToHostedPublicVirtualInterfaceAccepterMapOutput() HostedPublicVirtualInterfaceAccepterMapOutput {
return o
}
func (o HostedPublicVirtualInterfaceAccepterMapOutput) ToHostedPublicVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPublicVirtualInterfaceAccepterMapOutput {
return o
}
func (o HostedPublicVirtualInterfaceAccepterMapOutput) MapIndex(k pulumi.StringInput) HostedPublicVirtualInterfaceAccepterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostedPublicVirtualInterfaceAccepter {
return vs[0].(map[string]*HostedPublicVirtualInterfaceAccepter)[vs[1].(string)]
}).(HostedPublicVirtualInterfaceAccepterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostedPublicVirtualInterfaceAccepterInput)(nil)).Elem(), &HostedPublicVirtualInterfaceAccepter{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedPublicVirtualInterfaceAccepterArrayInput)(nil)).Elem(), HostedPublicVirtualInterfaceAccepterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HostedPublicVirtualInterfaceAccepterMapInput)(nil)).Elem(), HostedPublicVirtualInterfaceAccepterMap{})
pulumi.RegisterOutputType(HostedPublicVirtualInterfaceAccepterOutput{})
pulumi.RegisterOutputType(HostedPublicVirtualInterfaceAccepterArrayOutput{})
pulumi.RegisterOutputType(HostedPublicVirtualInterfaceAccepterMapOutput{})
}