-
Notifications
You must be signed in to change notification settings - Fork 151
/
getVpcEndpoint.go
105 lines (100 loc) · 4.5 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
// *** 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 (
"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"`
}