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
        {
            ServiceName = "com.amazonaws.us-west-2.s3",
            VpcId = aws_vpc.Foo.Id,
        }));
        var privateS3 = new Aws.Ec2.VpcEndpointRouteTableAssociation("privateS3", new Aws.Ec2.VpcEndpointRouteTableAssociationArgs
        {
            RouteTableId = aws_route_table.Private.Id,
            VpcEndpointId = s3.Apply(s3 => s3.Id),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "com.amazonaws.us-west-2.s3"
        opt1 := aws_vpc.Foo.Id
        s3, err := ec2.LookupVpcEndpoint(ctx, &ec2.LookupVpcEndpointArgs{
            ServiceName: &opt0,
            VpcId:       &opt1,
        }, nil)
        if err != nil {
            return err
        }
        _, err = ec2.NewVpcEndpointRouteTableAssociation(ctx, "privateS3", &ec2.VpcEndpointRouteTableAssociationArgs{
            RouteTableId:  pulumi.String(aws_route_table.Private.Id),
            VpcEndpointId: pulumi.String(s3.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

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

// Declare the data source
const s3 = aws_vpc_foo.id.apply(id => aws.ec2.getVpcEndpoint({
    serviceName: "com.amazonaws.us-west-2.s3",
    vpcId: id,
}, { async: true }));
const privateS3 = new aws.ec2.VpcEndpointRouteTableAssociation("private_s3", {
    routeTableId: aws_route_table_private.id,
    vpcEndpointId: s3.id!,
});

Using GetVpcEndpoint

function getVpcEndpoint(args: GetVpcEndpointArgs, opts?: InvokeOptions): Promise<GetVpcEndpointResult>
function  get_vpc_endpoint(filters=None, id=None, service_name=None, state=None, tags=None, vpc_id=None, opts=None)
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<GetVpcEndpointFilterArgs>

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 List[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 Dict[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 List[str]

The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type Gateway.

dns_entries List[GetVpcEndpointDnsEntry]

The DNS entries for the VPC Endpoint. Applicable for endpoints of type Interface. DNS blocks are documented below.

id str
network_interface_ids List[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 List[str]

One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type Gateway.

security_group_ids List[str]

One or more security groups associated with the network interfaces. Applicable for endpoints of type Interface.

service_name str
state str
subnet_ids List[str]

One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type Interface.

tags Dict[str, str]
vpc_endpoint_type str

The VPC Endpoint type, Gateway or Interface.

vpc_id str
filters List[GetVpcEndpointFilter]

Supporting Types

GetVpcEndpointDnsEntry

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 List[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.