-
Notifications
You must be signed in to change notification settings - Fork 151
/
getVpcEndpoint.go
246 lines (213 loc) · 11.3 KB
/
getVpcEndpoint.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
// *** 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 Endpoint data source provides details about
// a specific VPC endpoint.
//
// ## 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 := "com.amazonaws.us-west-2.s3"
// s3, err := ec2.LookupVpcEndpoint(ctx, &ec2.LookupVpcEndpointArgs{
// VpcId: &opt0,
// ServiceName: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// _, err = ec2.NewVpcEndpointRouteTableAssociation(ctx, "privateS3", &ec2.VpcEndpointRouteTableAssociationArgs{
// VpcEndpointId: pulumi.String(s3.Id),
// RouteTableId: pulumi.Any(aws_route_table.Private.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupVpcEndpoint(ctx *pulumi.Context, args *LookupVpcEndpointArgs, opts ...pulumi.InvokeOption) (*LookupVpcEndpointResult, error) {
var rv LookupVpcEndpointResult
err := ctx.Invoke("aws:ec2/getVpcEndpoint:getVpcEndpoint", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVpcEndpoint.
type LookupVpcEndpointArgs struct {
// Custom filter block as described below.
Filters []GetVpcEndpointFilter `pulumi:"filters"`
// The ID of the specific VPC Endpoint to retrieve.
Id *string `pulumi:"id"`
// The service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`).
ServiceName *string `pulumi:"serviceName"`
// The state of the specific VPC Endpoint to retrieve.
State *string `pulumi:"state"`
// A map of tags, each pair of which must exactly match
// a pair on the specific VPC Endpoint to retrieve.
Tags map[string]string `pulumi:"tags"`
// The ID of the VPC in which the specific VPC Endpoint is used.
VpcId *string `pulumi:"vpcId"`
}
// A collection of values returned by getVpcEndpoint.
type LookupVpcEndpointResult struct {
// The Amazon Resource Name (ARN) of the VPC endpoint.
Arn string `pulumi:"arn"`
// The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`.
CidrBlocks []string `pulumi:"cidrBlocks"`
// The DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS blocks are documented below.
DnsEntries []GetVpcEndpointDnsEntry `pulumi:"dnsEntries"`
Filters []GetVpcEndpointFilter `pulumi:"filters"`
Id string `pulumi:"id"`
// One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`.
NetworkInterfaceIds []string `pulumi:"networkInterfaceIds"`
// The ID of the AWS account that owns the VPC endpoint.
OwnerId string `pulumi:"ownerId"`
// The policy document associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`.
Policy string `pulumi:"policy"`
// The prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`.
PrefixListId string `pulumi:"prefixListId"`
// Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `Interface`.
PrivateDnsEnabled bool `pulumi:"privateDnsEnabled"`
// Whether or not the VPC Endpoint is being managed by its service - `true` or `false`.
RequesterManaged bool `pulumi:"requesterManaged"`
// One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`.
RouteTableIds []string `pulumi:"routeTableIds"`
// One or more security groups associated with the network interfaces. Applicable for endpoints of type `Interface`.
SecurityGroupIds []string `pulumi:"securityGroupIds"`
ServiceName string `pulumi:"serviceName"`
State string `pulumi:"state"`
// One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `Interface`.
SubnetIds []string `pulumi:"subnetIds"`
Tags map[string]string `pulumi:"tags"`
// The VPC Endpoint type, `Gateway` or `Interface`.
VpcEndpointType string `pulumi:"vpcEndpointType"`
VpcId string `pulumi:"vpcId"`
}
func LookupVpcEndpointOutput(ctx *pulumi.Context, args LookupVpcEndpointOutputArgs, opts ...pulumi.InvokeOption) LookupVpcEndpointResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupVpcEndpointResult, error) {
args := v.(LookupVpcEndpointArgs)
r, err := LookupVpcEndpoint(ctx, &args, opts...)
return *r, err
}).(LookupVpcEndpointResultOutput)
}
// A collection of arguments for invoking getVpcEndpoint.
type LookupVpcEndpointOutputArgs struct {
// Custom filter block as described below.
Filters GetVpcEndpointFilterArrayInput `pulumi:"filters"`
// The ID of the specific VPC Endpoint to retrieve.
Id pulumi.StringPtrInput `pulumi:"id"`
// The service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `com.amazonaws.<region>.<service>` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker.<region>.notebook`).
ServiceName pulumi.StringPtrInput `pulumi:"serviceName"`
// The state of the specific VPC Endpoint to retrieve.
State pulumi.StringPtrInput `pulumi:"state"`
// A map of tags, each pair of which must exactly match
// a pair on the specific VPC Endpoint to retrieve.
Tags pulumi.StringMapInput `pulumi:"tags"`
// The ID of the VPC in which the specific VPC Endpoint is used.
VpcId pulumi.StringPtrInput `pulumi:"vpcId"`
}
func (LookupVpcEndpointOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcEndpointArgs)(nil)).Elem()
}
// A collection of values returned by getVpcEndpoint.
type LookupVpcEndpointResultOutput struct{ *pulumi.OutputState }
func (LookupVpcEndpointResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupVpcEndpointResult)(nil)).Elem()
}
func (o LookupVpcEndpointResultOutput) ToLookupVpcEndpointResultOutput() LookupVpcEndpointResultOutput {
return o
}
func (o LookupVpcEndpointResultOutput) ToLookupVpcEndpointResultOutputWithContext(ctx context.Context) LookupVpcEndpointResultOutput {
return o
}
// The Amazon Resource Name (ARN) of the VPC endpoint.
func (o LookupVpcEndpointResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`.
func (o LookupVpcEndpointResultOutput) CidrBlocks() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.CidrBlocks }).(pulumi.StringArrayOutput)
}
// The DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS blocks are documented below.
func (o LookupVpcEndpointResultOutput) DnsEntries() GetVpcEndpointDnsEntryArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []GetVpcEndpointDnsEntry { return v.DnsEntries }).(GetVpcEndpointDnsEntryArrayOutput)
}
func (o LookupVpcEndpointResultOutput) Filters() GetVpcEndpointFilterArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []GetVpcEndpointFilter { return v.Filters }).(GetVpcEndpointFilterArrayOutput)
}
func (o LookupVpcEndpointResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Id }).(pulumi.StringOutput)
}
// One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`.
func (o LookupVpcEndpointResultOutput) NetworkInterfaceIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.NetworkInterfaceIds }).(pulumi.StringArrayOutput)
}
// The ID of the AWS account that owns the VPC endpoint.
func (o LookupVpcEndpointResultOutput) OwnerId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.OwnerId }).(pulumi.StringOutput)
}
// The policy document associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`.
func (o LookupVpcEndpointResultOutput) Policy() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.Policy }).(pulumi.StringOutput)
}
// The prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`.
func (o LookupVpcEndpointResultOutput) PrefixListId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.PrefixListId }).(pulumi.StringOutput)
}
// Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `Interface`.
func (o LookupVpcEndpointResultOutput) PrivateDnsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) bool { return v.PrivateDnsEnabled }).(pulumi.BoolOutput)
}
// Whether or not the VPC Endpoint is being managed by its service - `true` or `false`.
func (o LookupVpcEndpointResultOutput) RequesterManaged() pulumi.BoolOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) bool { return v.RequesterManaged }).(pulumi.BoolOutput)
}
// One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`.
func (o LookupVpcEndpointResultOutput) RouteTableIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.RouteTableIds }).(pulumi.StringArrayOutput)
}
// One or more security groups associated with the network interfaces. Applicable for endpoints of type `Interface`.
func (o LookupVpcEndpointResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
}
func (o LookupVpcEndpointResultOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.ServiceName }).(pulumi.StringOutput)
}
func (o LookupVpcEndpointResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.State }).(pulumi.StringOutput)
}
// One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `Interface`.
func (o LookupVpcEndpointResultOutput) SubnetIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput)
}
func (o LookupVpcEndpointResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The VPC Endpoint type, `Gateway` or `Interface`.
func (o LookupVpcEndpointResultOutput) VpcEndpointType() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.VpcEndpointType }).(pulumi.StringOutput)
}
func (o LookupVpcEndpointResultOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v LookupVpcEndpointResult) string { return v.VpcId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupVpcEndpointResultOutput{})
}