getVpcEndpoint

The VPC Endpoint data source provides details about a specific VPC endpoint.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var s3 = Output.Create(Aws.Ec2.GetVpcEndpoint.InvokeAsync(new Aws.Ec2.GetVpcEndpointArgs
        {
            VpcId = aws_vpc.Foo.Id,
            ServiceName = "com.amazonaws.us-west-2.s3",
        }));
        var privateS3 = new Aws.Ec2.VpcEndpointRouteTableAssociation("privateS3", new Aws.Ec2.VpcEndpointRouteTableAssociationArgs
        {
            VpcEndpointId = s3.Apply(s3 => s3.Id),
            RouteTableId = aws_route_table.Private.Id,
        });
    }

}
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
	})
}
import pulumi
import pulumi_aws as aws

s3 = aws.ec2.get_vpc_endpoint(vpc_id=aws_vpc["foo"]["id"],
    service_name="com.amazonaws.us-west-2.s3")
private_s3 = aws.ec2.VpcEndpointRouteTableAssociation("privateS3",
    vpc_endpoint_id=s3.id,
    route_table_id=aws_route_table["private"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const s3 = aws.ec2.getVpcEndpoint({
    vpcId: aws_vpc.foo.id,
    serviceName: "com.amazonaws.us-west-2.s3",
});
const privateS3 = new aws.ec2.VpcEndpointRouteTableAssociation("privateS3", {
    vpcEndpointId: s3.then(s3 => s3.id),
    routeTableId: aws_route_table["private"].id,
});

Using getVpcEndpoint

function getVpcEndpoint(args: GetVpcEndpointArgs, opts?: InvokeOptions): Promise<GetVpcEndpointResult>
def get_vpc_endpoint(filters: Optional[Sequence[GetVpcEndpointFilter]] = None,
                     id: Optional[str] = None,
                     service_name: Optional[str] = None,
                     state: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     vpc_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetVpcEndpointResult
func LookupVpcEndpoint(ctx *Context, args *LookupVpcEndpointArgs, opts ...InvokeOption) (*LookupVpcEndpointResult, error)

Note: This function is named LookupVpcEndpoint in the Go SDK.

public static class GetVpcEndpoint {
    public static Task<GetVpcEndpointResult> InvokeAsync(GetVpcEndpointArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetVpcEndpointFilter>
Custom filter block as described below.
Id string
The ID of the specific VPC Endpoint to retrieve.
ServiceName string
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).
State string
The state of the specific VPC Endpoint to retrieve.
Tags Dictionary<string, string>
A map of tags, each pair of which must exactly match a pair on the specific VPC Endpoint to retrieve.
VpcId string
The ID of the VPC in which the specific VPC Endpoint is used.
Filters []GetVpcEndpointFilter
Custom filter block as described below.
Id string
The ID of the specific VPC Endpoint to retrieve.
ServiceName string
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).
State string
The state of the specific VPC Endpoint to retrieve.
Tags map[string]string
A map of tags, each pair of which must exactly match a pair on the specific VPC Endpoint to retrieve.
VpcId string
The ID of the VPC in which the specific VPC Endpoint is used.
filters GetVpcEndpointFilter[]
Custom filter block as described below.
id string
The ID of the specific VPC Endpoint to retrieve.
serviceName string
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).
state string
The state of the specific VPC Endpoint to retrieve.
tags {[key: string]: string}
A map of tags, each pair of which must exactly match a pair on the specific VPC Endpoint to retrieve.
vpcId string
The ID of the VPC in which the specific VPC Endpoint is used.
filters Sequence[GetVpcEndpointFilter]
Custom filter block as described below.
id str
The ID of the specific VPC Endpoint to retrieve.
service_name str
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).
state str
The state of the specific VPC Endpoint to retrieve.
tags Mapping[str, str]
A map of tags, each pair of which must exactly match a pair on the specific VPC Endpoint to retrieve.
vpc_id str
The ID of the VPC in which the specific VPC Endpoint is used.

getVpcEndpoint Result

The following output properties are available:

Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
CidrBlocks List<string>
The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type Gateway.
DnsEntries List<GetVpcEndpointDnsEntry>
The DNS entries for the VPC Endpoint. Applicable for endpoints of type Interface. DNS blocks are documented below.
Id string
NetworkInterfaceIds List<string>
One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type Interface.
OwnerId string
The ID of the AWS account that owns the VPC endpoint.
Policy string
The policy document associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
PrefixListId string
The prefix list ID of the exposed AWS service. Applicable for endpoints of type Gateway.
PrivateDnsEnabled bool
Whether or not the VPC is associated with a private hosted zone - true or false. Applicable for endpoints of type Interface.
RequesterManaged bool
Whether or not the VPC Endpoint is being managed by its service - true or false.
RouteTableIds List<string>
One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
SecurityGroupIds List<string>
One or more security groups associated with the network interfaces. Applicable for endpoints of type Interface.
ServiceName string
State string
SubnetIds List<string>
One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type Interface.
Tags Dictionary<string, string>
VpcEndpointType string
The VPC Endpoint type, Gateway or Interface.
VpcId string
Filters List<GetVpcEndpointFilter>
Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
CidrBlocks []string
The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type Gateway.
DnsEntries []GetVpcEndpointDnsEntry
The DNS entries for the VPC Endpoint. Applicable for endpoints of type Interface. DNS blocks are documented below.
Id string
NetworkInterfaceIds []string
One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type Interface.
OwnerId string
The ID of the AWS account that owns the VPC endpoint.
Policy string
The policy document associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
PrefixListId string
The prefix list ID of the exposed AWS service. Applicable for endpoints of type Gateway.
PrivateDnsEnabled bool
Whether or not the VPC is associated with a private hosted zone - true or false. Applicable for endpoints of type Interface.
RequesterManaged bool
Whether or not the VPC Endpoint is being managed by its service - true or false.
RouteTableIds []string
One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
SecurityGroupIds []string
One or more security groups associated with the network interfaces. Applicable for endpoints of type Interface.
ServiceName string
State string
SubnetIds []string
One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type Interface.
Tags map[string]string
VpcEndpointType string
The VPC Endpoint type, Gateway or Interface.
VpcId string
Filters []GetVpcEndpointFilter
arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
cidrBlocks string[]
The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type Gateway.
dnsEntries GetVpcEndpointDnsEntry[]
The DNS entries for the VPC Endpoint. Applicable for endpoints of type Interface. DNS blocks are documented below.
id string
networkInterfaceIds string[]
One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type Interface.
ownerId string
The ID of the AWS account that owns the VPC endpoint.
policy string
The policy document associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
prefixListId string
The prefix list ID of the exposed AWS service. Applicable for endpoints of type Gateway.
privateDnsEnabled boolean
Whether or not the VPC is associated with a private hosted zone - true or false. Applicable for endpoints of type Interface.
requesterManaged boolean
Whether or not the VPC Endpoint is being managed by its service - true or false.
routeTableIds string[]
One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
securityGroupIds string[]
One or more security groups associated with the network interfaces. Applicable for endpoints of type Interface.
serviceName string
state string
subnetIds string[]
One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type Interface.
tags {[key: string]: string}
vpcEndpointType string
The VPC Endpoint type, Gateway or Interface.
vpcId string
filters GetVpcEndpointFilter[]
arn str
The Amazon Resource Name (ARN) of the VPC endpoint.
cidr_blocks Sequence[str]
The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type Gateway.
dns_entries Sequence[GetVpcEndpointDnsEntry]
The DNS entries for the VPC Endpoint. Applicable for endpoints of type Interface. DNS blocks are documented below.
id str
network_interface_ids Sequence[str]
One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type Interface.
owner_id str
The ID of the AWS account that owns the VPC endpoint.
policy str
The policy document associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
prefix_list_id str
The prefix list ID of the exposed AWS service. Applicable for endpoints of type Gateway.
private_dns_enabled bool
Whether or not the VPC is associated with a private hosted zone - true or false. Applicable for endpoints of type Interface.
requester_managed bool
Whether or not the VPC Endpoint is being managed by its service - true or false.
route_table_ids Sequence[str]
One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type Gateway.
security_group_ids Sequence[str]
One or more security groups associated with the network interfaces. Applicable for endpoints of type Interface.
service_name str
state str
subnet_ids Sequence[str]
One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type Interface.
tags Mapping[str, str]
vpc_endpoint_type str
The VPC Endpoint type, Gateway or Interface.
vpc_id str
filters Sequence[GetVpcEndpointFilter]

Supporting Types

GetVpcEndpointDnsEntry

DnsName string
The DNS name.
HostedZoneId string
The ID of the private hosted zone.
DnsName string
The DNS name.
HostedZoneId string
The ID of the private hosted zone.
dnsName string
The DNS name.
hostedZoneId string
The ID of the private hosted zone.
dns_name str
The DNS name.
hosted_zone_id str
The ID of the private hosted zone.

GetVpcEndpointFilter

Name string
The name of the field to filter by, as defined by the underlying AWS API.
Values List<string>
Set of values that are accepted for the given field. A VPC Endpoint will be selected if any one of the given values matches.
Name string
The name of the field to filter by, as defined by the underlying AWS API.
Values []string
Set of values that are accepted for the given field. A VPC Endpoint will be selected if any one of the given values matches.
name string
The name of the field to filter by, as defined by the underlying AWS API.
values string[]
Set of values that are accepted for the given field. A VPC Endpoint will be selected if any one of the given values matches.
name str
The name of the field to filter by, as defined by the underlying AWS API.
values Sequence[str]
Set of values that are accepted for the given field. A VPC Endpoint will be selected if any one of the given values matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.