-
Notifications
You must be signed in to change notification settings - Fork 151
/
getVpcPeeringConnection.go
252 lines (222 loc) · 11.8 KB
/
getVpcPeeringConnection.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
// *** 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 ec2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The VPC Peering Connection data source provides details about
// a specific VPC peering connection.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := aws_vpc.Foo.Id
// opt1 := "10.0.1.0/22"
// pc, err := ec2.LookupVpcPeeringConnection(ctx, &ec2.LookupVpcPeeringConnectionArgs{
// VpcId: &opt0,
// PeerCidrBlock: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// rt, err := ec2.NewRouteTable(ctx, "rt", &ec2.RouteTableArgs{
// VpcId: pulumi.Any(aws_vpc.Foo.Id),
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewRoute(ctx, "route", &ec2.RouteArgs{
// RouteTableId: rt.ID(),
// DestinationCidrBlock: pulumi.String(pc.PeerCidrBlock),
// VpcPeeringConnectionId: pulumi.String(pc.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupVpcPeeringConnection(ctx *pulumi.Context, args *LookupVpcPeeringConnectionArgs, opts ...pulumi.InvokeOption) (*LookupVpcPeeringConnectionResult, error) {
var rv LookupVpcPeeringConnectionResult
err := ctx.Invoke("aws:ec2/getVpcPeeringConnection:getVpcPeeringConnection", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVpcPeeringConnection.
type LookupVpcPeeringConnectionArgs struct {
// The primary CIDR block of the requester VPC of the specific VPC Peering Connection to retrieve.
CidrBlock *string `pulumi:"cidrBlock"`
// Custom filter block as described below.
Filters []GetVpcPeeringConnectionFilter `pulumi:"filters"`
// The ID of the specific VPC Peering Connection to retrieve.
Id *string `pulumi:"id"`
// The AWS account ID of the owner of the requester VPC of the specific VPC Peering Connection to retrieve.
OwnerId *string `pulumi:"ownerId"`
// The primary CIDR block of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerCidrBlock *string `pulumi:"peerCidrBlock"`
// The AWS account ID of the owner of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerOwnerId *string `pulumi:"peerOwnerId"`
// The region of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerRegion *string `pulumi:"peerRegion"`
// The ID of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerVpcId *string `pulumi:"peerVpcId"`
// The region of the requester VPC of the specific VPC Peering Connection to retrieve.
Region *string `pulumi:"region"`
// The status of the specific VPC Peering Connection to retrieve.
Status *string `pulumi:"status"`
// A map of tags, each pair of which must exactly match
// a pair on the desired VPC Peering Connection.
Tags map[string]string `pulumi:"tags"`
// The ID of the requester VPC of the specific VPC Peering Connection to retrieve.
VpcId *string `pulumi:"vpcId"`
}
// A collection of values returned by getVpcPeeringConnection.
type LookupVpcPeeringConnectionResult struct {
// A configuration block that describes [VPC Peering Connection]
// (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
Accepter map[string]bool `pulumi:"accepter"`
// A CIDR block associated to the VPC of the specific VPC Peering Connection.
CidrBlock string `pulumi:"cidrBlock"`
// List of objects with CIDR blocks of the requester VPC.
CidrBlockSets []GetVpcPeeringConnectionCidrBlockSet `pulumi:"cidrBlockSets"`
Filters []GetVpcPeeringConnectionFilter `pulumi:"filters"`
Id string `pulumi:"id"`
OwnerId string `pulumi:"ownerId"`
PeerCidrBlock string `pulumi:"peerCidrBlock"`
// List of objects with CIDR blocks of the accepter VPC.
PeerCidrBlockSets []GetVpcPeeringConnectionPeerCidrBlockSet `pulumi:"peerCidrBlockSets"`
PeerOwnerId string `pulumi:"peerOwnerId"`
PeerRegion string `pulumi:"peerRegion"`
PeerVpcId string `pulumi:"peerVpcId"`
Region string `pulumi:"region"`
// A configuration block that describes [VPC Peering Connection]
// (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
Requester map[string]bool `pulumi:"requester"`
Status string `pulumi:"status"`
Tags map[string]string `pulumi:"tags"`
VpcId string `pulumi:"vpcId"`
}
func LookupVpcPeeringConnectionOutput(ctx *pulumi.Context, args LookupVpcPeeringConnectionOutputArgs, opts ...pulumi.InvokeOption) LookupVpcPeeringConnectionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVpcPeeringConnectionResult, error) {
args := v.(LookupVpcPeeringConnectionArgs)
r, err := LookupVpcPeeringConnection(ctx, &args, opts...)
return *r, err
}).(LookupVpcPeeringConnectionResultOutput)
}
// A collection of arguments for invoking getVpcPeeringConnection.
type LookupVpcPeeringConnectionOutputArgs struct {
// The primary CIDR block of the requester VPC of the specific VPC Peering Connection to retrieve.
CidrBlock pulumi.StringPtrInput `pulumi:"cidrBlock"`
// Custom filter block as described below.
Filters GetVpcPeeringConnectionFilterArrayInput `pulumi:"filters"`
// The ID of the specific VPC Peering Connection to retrieve.
Id pulumi.StringPtrInput `pulumi:"id"`
// The AWS account ID of the owner of the requester VPC of the specific VPC Peering Connection to retrieve.
OwnerId pulumi.StringPtrInput `pulumi:"ownerId"`
// The primary CIDR block of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerCidrBlock pulumi.StringPtrInput `pulumi:"peerCidrBlock"`
// The AWS account ID of the owner of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerOwnerId pulumi.StringPtrInput `pulumi:"peerOwnerId"`
// The region of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerRegion pulumi.StringPtrInput `pulumi:"peerRegion"`
// The ID of the accepter VPC of the specific VPC Peering Connection to retrieve.
PeerVpcId pulumi.StringPtrInput `pulumi:"peerVpcId"`
// The region of the requester VPC of the specific VPC Peering Connection to retrieve.
Region pulumi.StringPtrInput `pulumi:"region"`
// The status of the specific VPC Peering Connection to retrieve.
Status pulumi.StringPtrInput `pulumi:"status"`
// A map of tags, each pair of which must exactly match
// a pair on the desired VPC Peering Connection.
Tags pulumi.StringMapInput `pulumi:"tags"`
// The ID of the requester VPC of the specific VPC Peering Connection to retrieve.
VpcId pulumi.StringPtrInput `pulumi:"vpcId"`
}
func (LookupVpcPeeringConnectionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcPeeringConnectionArgs)(nil)).Elem()
}
// A collection of values returned by getVpcPeeringConnection.
type LookupVpcPeeringConnectionResultOutput struct{ *pulumi.OutputState }
func (LookupVpcPeeringConnectionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcPeeringConnectionResult)(nil)).Elem()
}
func (o LookupVpcPeeringConnectionResultOutput) ToLookupVpcPeeringConnectionResultOutput() LookupVpcPeeringConnectionResultOutput {
return o
}
func (o LookupVpcPeeringConnectionResultOutput) ToLookupVpcPeeringConnectionResultOutputWithContext(ctx context.Context) LookupVpcPeeringConnectionResultOutput {
return o
}
// A configuration block that describes [VPC Peering Connection]
// (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
func (o LookupVpcPeeringConnectionResultOutput) Accepter() pulumi.BoolMapOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) map[string]bool { return v.Accepter }).(pulumi.BoolMapOutput)
}
// A CIDR block associated to the VPC of the specific VPC Peering Connection.
func (o LookupVpcPeeringConnectionResultOutput) CidrBlock() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.CidrBlock }).(pulumi.StringOutput)
}
// List of objects with CIDR blocks of the requester VPC.
func (o LookupVpcPeeringConnectionResultOutput) CidrBlockSets() GetVpcPeeringConnectionCidrBlockSetArrayOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) []GetVpcPeeringConnectionCidrBlockSet { return v.CidrBlockSets }).(GetVpcPeeringConnectionCidrBlockSetArrayOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) Filters() GetVpcPeeringConnectionFilterArrayOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) []GetVpcPeeringConnectionFilter { return v.Filters }).(GetVpcPeeringConnectionFilterArrayOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) OwnerId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.OwnerId }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) PeerCidrBlock() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.PeerCidrBlock }).(pulumi.StringOutput)
}
// List of objects with CIDR blocks of the accepter VPC.
func (o LookupVpcPeeringConnectionResultOutput) PeerCidrBlockSets() GetVpcPeeringConnectionPeerCidrBlockSetArrayOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) []GetVpcPeeringConnectionPeerCidrBlockSet {
return v.PeerCidrBlockSets
}).(GetVpcPeeringConnectionPeerCidrBlockSetArrayOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) PeerOwnerId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.PeerOwnerId }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) PeerRegion() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.PeerRegion }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) PeerVpcId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.PeerVpcId }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.Region }).(pulumi.StringOutput)
}
// A configuration block that describes [VPC Peering Connection]
// (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
func (o LookupVpcPeeringConnectionResultOutput) Requester() pulumi.BoolMapOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) map[string]bool { return v.Requester }).(pulumi.BoolMapOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.Status }).(pulumi.StringOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func (o LookupVpcPeeringConnectionResultOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcPeeringConnectionResult) string { return v.VpcId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVpcPeeringConnectionResultOutput{})
}