/
vpcAssociationAuthorization.go
367 lines (306 loc) · 14.6 KB
/
vpcAssociationAuthorization.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
// *** 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 route53
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Authorizes a VPC in a different account to be associated with a local Route53 Hosted Zone.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/providers"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := providers.Newaws(ctx, "alternate", nil)
// if err != nil {
// return err
// }
// exampleVpc, err := ec2.NewVpc(ctx, "exampleVpc", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.6.0.0/16"),
// EnableDnsHostnames: pulumi.Bool(true),
// EnableDnsSupport: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// exampleZone, err := route53.NewZone(ctx, "exampleZone", &route53.ZoneArgs{
// Vpcs: route53.ZoneVpcArray{
// &route53.ZoneVpcArgs{
// VpcId: exampleVpc.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// alternateVpc, err := ec2.NewVpc(ctx, "alternateVpc", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.7.0.0/16"),
// EnableDnsHostnames: pulumi.Bool(true),
// EnableDnsSupport: pulumi.Bool(true),
// }, pulumi.Provider("aws.alternate"))
// if err != nil {
// return err
// }
// exampleVpcAssociationAuthorization, err := route53.NewVpcAssociationAuthorization(ctx, "exampleVpcAssociationAuthorization", &route53.VpcAssociationAuthorizationArgs{
// VpcId: alternateVpc.ID(),
// ZoneId: exampleZone.ID(),
// })
// if err != nil {
// return err
// }
// _, err = route53.NewZoneAssociation(ctx, "exampleZoneAssociation", &route53.ZoneAssociationArgs{
// VpcId: exampleVpcAssociationAuthorization.VpcId,
// ZoneId: exampleVpcAssociationAuthorization.ZoneId,
// }, pulumi.Provider("aws.alternate"))
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Route 53 VPC Association Authorizations can be imported via the Hosted Zone ID and VPC ID, separated by a colon (`:`), e.g.
//
// ```sh
// $ pulumi import aws:route53/vpcAssociationAuthorization:VpcAssociationAuthorization example Z123456ABCDEFG:vpc-12345678
// ```
type VpcAssociationAuthorization struct {
pulumi.CustomResourceState
// The VPC to authorize for association with the private hosted zone.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
// The VPC's region. Defaults to the region of the AWS provider.
VpcRegion pulumi.StringOutput `pulumi:"vpcRegion"`
// The ID of the private hosted zone that you want to authorize associating a VPC with.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewVpcAssociationAuthorization registers a new resource with the given unique name, arguments, and options.
func NewVpcAssociationAuthorization(ctx *pulumi.Context,
name string, args *VpcAssociationAuthorizationArgs, opts ...pulumi.ResourceOption) (*VpcAssociationAuthorization, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
if args.ZoneId == nil {
return nil, errors.New("invalid value for required argument 'ZoneId'")
}
var resource VpcAssociationAuthorization
err := ctx.RegisterResource("aws:route53/vpcAssociationAuthorization:VpcAssociationAuthorization", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVpcAssociationAuthorization gets an existing VpcAssociationAuthorization 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 GetVpcAssociationAuthorization(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VpcAssociationAuthorizationState, opts ...pulumi.ResourceOption) (*VpcAssociationAuthorization, error) {
var resource VpcAssociationAuthorization
err := ctx.ReadResource("aws:route53/vpcAssociationAuthorization:VpcAssociationAuthorization", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VpcAssociationAuthorization resources.
type vpcAssociationAuthorizationState struct {
// The VPC to authorize for association with the private hosted zone.
VpcId *string `pulumi:"vpcId"`
// The VPC's region. Defaults to the region of the AWS provider.
VpcRegion *string `pulumi:"vpcRegion"`
// The ID of the private hosted zone that you want to authorize associating a VPC with.
ZoneId *string `pulumi:"zoneId"`
}
type VpcAssociationAuthorizationState struct {
// The VPC to authorize for association with the private hosted zone.
VpcId pulumi.StringPtrInput
// The VPC's region. Defaults to the region of the AWS provider.
VpcRegion pulumi.StringPtrInput
// The ID of the private hosted zone that you want to authorize associating a VPC with.
ZoneId pulumi.StringPtrInput
}
func (VpcAssociationAuthorizationState) ElementType() reflect.Type {
return reflect.TypeOf((*vpcAssociationAuthorizationState)(nil)).Elem()
}
type vpcAssociationAuthorizationArgs struct {
// The VPC to authorize for association with the private hosted zone.
VpcId string `pulumi:"vpcId"`
// The VPC's region. Defaults to the region of the AWS provider.
VpcRegion *string `pulumi:"vpcRegion"`
// The ID of the private hosted zone that you want to authorize associating a VPC with.
ZoneId string `pulumi:"zoneId"`
}
// The set of arguments for constructing a VpcAssociationAuthorization resource.
type VpcAssociationAuthorizationArgs struct {
// The VPC to authorize for association with the private hosted zone.
VpcId pulumi.StringInput
// The VPC's region. Defaults to the region of the AWS provider.
VpcRegion pulumi.StringPtrInput
// The ID of the private hosted zone that you want to authorize associating a VPC with.
ZoneId pulumi.StringInput
}
func (VpcAssociationAuthorizationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*vpcAssociationAuthorizationArgs)(nil)).Elem()
}
type VpcAssociationAuthorizationInput interface {
pulumi.Input
ToVpcAssociationAuthorizationOutput() VpcAssociationAuthorizationOutput
ToVpcAssociationAuthorizationOutputWithContext(ctx context.Context) VpcAssociationAuthorizationOutput
}
func (*VpcAssociationAuthorization) ElementType() reflect.Type {
return reflect.TypeOf((*VpcAssociationAuthorization)(nil))
}
func (i *VpcAssociationAuthorization) ToVpcAssociationAuthorizationOutput() VpcAssociationAuthorizationOutput {
return i.ToVpcAssociationAuthorizationOutputWithContext(context.Background())
}
func (i *VpcAssociationAuthorization) ToVpcAssociationAuthorizationOutputWithContext(ctx context.Context) VpcAssociationAuthorizationOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcAssociationAuthorizationOutput)
}
func (i *VpcAssociationAuthorization) ToVpcAssociationAuthorizationPtrOutput() VpcAssociationAuthorizationPtrOutput {
return i.ToVpcAssociationAuthorizationPtrOutputWithContext(context.Background())
}
func (i *VpcAssociationAuthorization) ToVpcAssociationAuthorizationPtrOutputWithContext(ctx context.Context) VpcAssociationAuthorizationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcAssociationAuthorizationPtrOutput)
}
type VpcAssociationAuthorizationPtrInput interface {
pulumi.Input
ToVpcAssociationAuthorizationPtrOutput() VpcAssociationAuthorizationPtrOutput
ToVpcAssociationAuthorizationPtrOutputWithContext(ctx context.Context) VpcAssociationAuthorizationPtrOutput
}
type vpcAssociationAuthorizationPtrType VpcAssociationAuthorizationArgs
func (*vpcAssociationAuthorizationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**VpcAssociationAuthorization)(nil))
}
func (i *vpcAssociationAuthorizationPtrType) ToVpcAssociationAuthorizationPtrOutput() VpcAssociationAuthorizationPtrOutput {
return i.ToVpcAssociationAuthorizationPtrOutputWithContext(context.Background())
}
func (i *vpcAssociationAuthorizationPtrType) ToVpcAssociationAuthorizationPtrOutputWithContext(ctx context.Context) VpcAssociationAuthorizationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcAssociationAuthorizationPtrOutput)
}
// VpcAssociationAuthorizationArrayInput is an input type that accepts VpcAssociationAuthorizationArray and VpcAssociationAuthorizationArrayOutput values.
// You can construct a concrete instance of `VpcAssociationAuthorizationArrayInput` via:
//
// VpcAssociationAuthorizationArray{ VpcAssociationAuthorizationArgs{...} }
type VpcAssociationAuthorizationArrayInput interface {
pulumi.Input
ToVpcAssociationAuthorizationArrayOutput() VpcAssociationAuthorizationArrayOutput
ToVpcAssociationAuthorizationArrayOutputWithContext(context.Context) VpcAssociationAuthorizationArrayOutput
}
type VpcAssociationAuthorizationArray []VpcAssociationAuthorizationInput
func (VpcAssociationAuthorizationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*VpcAssociationAuthorization)(nil)).Elem()
}
func (i VpcAssociationAuthorizationArray) ToVpcAssociationAuthorizationArrayOutput() VpcAssociationAuthorizationArrayOutput {
return i.ToVpcAssociationAuthorizationArrayOutputWithContext(context.Background())
}
func (i VpcAssociationAuthorizationArray) ToVpcAssociationAuthorizationArrayOutputWithContext(ctx context.Context) VpcAssociationAuthorizationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcAssociationAuthorizationArrayOutput)
}
// VpcAssociationAuthorizationMapInput is an input type that accepts VpcAssociationAuthorizationMap and VpcAssociationAuthorizationMapOutput values.
// You can construct a concrete instance of `VpcAssociationAuthorizationMapInput` via:
//
// VpcAssociationAuthorizationMap{ "key": VpcAssociationAuthorizationArgs{...} }
type VpcAssociationAuthorizationMapInput interface {
pulumi.Input
ToVpcAssociationAuthorizationMapOutput() VpcAssociationAuthorizationMapOutput
ToVpcAssociationAuthorizationMapOutputWithContext(context.Context) VpcAssociationAuthorizationMapOutput
}
type VpcAssociationAuthorizationMap map[string]VpcAssociationAuthorizationInput
func (VpcAssociationAuthorizationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*VpcAssociationAuthorization)(nil)).Elem()
}
func (i VpcAssociationAuthorizationMap) ToVpcAssociationAuthorizationMapOutput() VpcAssociationAuthorizationMapOutput {
return i.ToVpcAssociationAuthorizationMapOutputWithContext(context.Background())
}
func (i VpcAssociationAuthorizationMap) ToVpcAssociationAuthorizationMapOutputWithContext(ctx context.Context) VpcAssociationAuthorizationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(VpcAssociationAuthorizationMapOutput)
}
type VpcAssociationAuthorizationOutput struct{ *pulumi.OutputState }
func (VpcAssociationAuthorizationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*VpcAssociationAuthorization)(nil))
}
func (o VpcAssociationAuthorizationOutput) ToVpcAssociationAuthorizationOutput() VpcAssociationAuthorizationOutput {
return o
}
func (o VpcAssociationAuthorizationOutput) ToVpcAssociationAuthorizationOutputWithContext(ctx context.Context) VpcAssociationAuthorizationOutput {
return o
}
func (o VpcAssociationAuthorizationOutput) ToVpcAssociationAuthorizationPtrOutput() VpcAssociationAuthorizationPtrOutput {
return o.ToVpcAssociationAuthorizationPtrOutputWithContext(context.Background())
}
func (o VpcAssociationAuthorizationOutput) ToVpcAssociationAuthorizationPtrOutputWithContext(ctx context.Context) VpcAssociationAuthorizationPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v VpcAssociationAuthorization) *VpcAssociationAuthorization {
return &v
}).(VpcAssociationAuthorizationPtrOutput)
}
type VpcAssociationAuthorizationPtrOutput struct{ *pulumi.OutputState }
func (VpcAssociationAuthorizationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**VpcAssociationAuthorization)(nil))
}
func (o VpcAssociationAuthorizationPtrOutput) ToVpcAssociationAuthorizationPtrOutput() VpcAssociationAuthorizationPtrOutput {
return o
}
func (o VpcAssociationAuthorizationPtrOutput) ToVpcAssociationAuthorizationPtrOutputWithContext(ctx context.Context) VpcAssociationAuthorizationPtrOutput {
return o
}
func (o VpcAssociationAuthorizationPtrOutput) Elem() VpcAssociationAuthorizationOutput {
return o.ApplyT(func(v *VpcAssociationAuthorization) VpcAssociationAuthorization {
if v != nil {
return *v
}
var ret VpcAssociationAuthorization
return ret
}).(VpcAssociationAuthorizationOutput)
}
type VpcAssociationAuthorizationArrayOutput struct{ *pulumi.OutputState }
func (VpcAssociationAuthorizationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]VpcAssociationAuthorization)(nil))
}
func (o VpcAssociationAuthorizationArrayOutput) ToVpcAssociationAuthorizationArrayOutput() VpcAssociationAuthorizationArrayOutput {
return o
}
func (o VpcAssociationAuthorizationArrayOutput) ToVpcAssociationAuthorizationArrayOutputWithContext(ctx context.Context) VpcAssociationAuthorizationArrayOutput {
return o
}
func (o VpcAssociationAuthorizationArrayOutput) Index(i pulumi.IntInput) VpcAssociationAuthorizationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) VpcAssociationAuthorization {
return vs[0].([]VpcAssociationAuthorization)[vs[1].(int)]
}).(VpcAssociationAuthorizationOutput)
}
type VpcAssociationAuthorizationMapOutput struct{ *pulumi.OutputState }
func (VpcAssociationAuthorizationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]VpcAssociationAuthorization)(nil))
}
func (o VpcAssociationAuthorizationMapOutput) ToVpcAssociationAuthorizationMapOutput() VpcAssociationAuthorizationMapOutput {
return o
}
func (o VpcAssociationAuthorizationMapOutput) ToVpcAssociationAuthorizationMapOutputWithContext(ctx context.Context) VpcAssociationAuthorizationMapOutput {
return o
}
func (o VpcAssociationAuthorizationMapOutput) MapIndex(k pulumi.StringInput) VpcAssociationAuthorizationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) VpcAssociationAuthorization {
return vs[0].(map[string]VpcAssociationAuthorization)[vs[1].(string)]
}).(VpcAssociationAuthorizationOutput)
}
func init() {
pulumi.RegisterOutputType(VpcAssociationAuthorizationOutput{})
pulumi.RegisterOutputType(VpcAssociationAuthorizationPtrOutput{})
pulumi.RegisterOutputType(VpcAssociationAuthorizationArrayOutput{})
pulumi.RegisterOutputType(VpcAssociationAuthorizationMapOutput{})
}