Table: aws_vpc_endpoint - Query AWS VPC Endpoints using SQL
The AWS VPC Endpoints allow private connectivity to services hosted in AWS, directly from your Virtual Private Cloud (VPC) and without the need for an Internet Gateway, VPN, Network Address Translation (NAT) devices, or firewall proxies. This service is primarily used to securely access AWS services without requiring an internet gateway in your VPC. They enhance the privacy and security of your VPC by not exposing it to the public internet.
Table Usage Guide
The aws_vpc_endpoint
table in Steampipe provides you with information about VPC Endpoints within Amazon Virtual Private Cloud (VPC). This table allows you, as a network administrator or DevOps engineer, to query endpoint-specific details, including its service configuration, type (Interface or Gateway), status, and associated resources such as network interfaces, DNS entries, and security groups. You can utilize this table to gather insights on VPC Endpoints, such as their accessibility, security configuration, and integration with other AWS services. The schema outlines the various attributes of the VPC Endpoint for you, including the endpoint ID, VPC ID, service name, and associated tags.
Examples
List of VPC endpoint and the corresponding services
Explore which services are associated with each VPC endpoint to better manage network traffic and enhance security in your AWS infrastructure. This could be particularly useful in identifying any misconfigurations or unnecessary connections.
select vpc_endpoint_id, vpc_id, service_namefrom aws_vpc_endpoint;
select vpc_endpoint_id, vpc_id, service_namefrom aws_vpc_endpoint;
Subnet Id count for each VPC endpoints
Explore the number of subnets associated with each VPC endpoint to better manage and organize your network infrastructure. This can aid in optimizing network performance and planning future network development.
select vpc_endpoint_id, jsonb_array_length(subnet_ids) as subnet_id_countfrom aws_vpc_endpoint;
select vpc_endpoint_id, json_array_length(subnet_ids) as subnet_id_countfrom aws_vpc_endpoint;
Network details for each VPC endpoint
Determine the areas in which specific network details for each VPC endpoint are configured. This information can be used to assess the network configuration and understand the relationships between different elements within the VPC.
select vpc_endpoint_id, vpc_id, jsonb_array_elements(subnet_ids) as subnet_ids, jsonb_array_elements(network_interface_ids) as network_interface_ids, jsonb_array_elements(route_table_ids) as route_table_ids, sg ->> 'GroupName' as sg_namefrom aws_vpc_endpoint cross join jsonb_array_elements(groups) as sg;
select vpc_endpoint_id, vpc_id, json_extract(subnet_id.value, '$') as subnet_ids, json_extract(network_interface_id.value, '$') as network_interface_ids, json_extract(route_table_id.value, '$') as route_table_ids, json_extract(sg.value, '$.GroupName') as sg_namefrom aws_vpc_endpoint, json_each(subnet_ids) as subnet_id, json_each(network_interface_ids) as network_interface_id, json_each(route_table_ids) as route_table_id, json_each(groups) as sg;
DNS information for the VPC endpoints
Determine the areas in which DNS is enabled for your VPC endpoints, allowing you to assess the elements within your network's private DNS configuration. This can help you manage and optimize your network infrastructure.
select vpc_endpoint_id, private_dns_enabled, dns ->> 'DnsName' as dns_name, dns ->> 'HostedZoneId' as hosted_zone_idfrom aws_vpc_endpoint cross join jsonb_array_elements(dns_entries) as dns;
select vpc_endpoint_id, private_dns_enabled, json_extract(dns.value, '$.DnsName') as dns_name, json_extract(dns.value, '$.HostedZoneId') as hosted_zone_idfrom aws_vpc_endpoint, json_each(dns_entries) as dns;
VPC endpoint count by VPC ID
Explore the number of VPC endpoints associated with each VPC ID to manage network traffic and enhance security within your AWS environment. This can be useful in identifying potential areas of congestion or security vulnerabilities.
select vpc_id, count(vpc_endpoint_id) as vpc_endpoint_countfrom aws_vpc_endpointgroup by vpc_id;
select vpc_id, count(vpc_endpoint_id) as vpc_endpoint_countfrom aws_vpc_endpointgroup by vpc_id;
Count endpoints by endpoint type
select vpc_endpoint_type, count(vpc_endpoint_id)from aws_vpc_endpointgroup by vpc_endpoint_type;
List 'interface' type VPC Endpoints
select vpc_endpoint_id, service_name, vpc_id, vpc_endpoint_typefrom aws_vpc_endpointwhere vpc_endpoint_type = 'Interface';
Query examples
Control examples
Schema for aws_vpc_endpoint
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
creation_timestamp | timestamp with time zone | The date and time that the VPC endpoint was created. | |
dns_entries | jsonb | The DNS entries for the endpoint. | |
groups | jsonb | Information about the security groups that are associated with the network interface. | |
network_interface_ids | jsonb | One or more network interfaces for the endpoint. | |
owner_id | text | The ID of the AWS account that owns the VPC endpoint. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
policy | jsonb | The policy document associated with the endpoint, if applicable. | |
policy_std | jsonb | Contains the policy in a canonical form for easier searching. | |
private_dns_enabled | boolean | Indicates whether the VPC is associated with a private hosted zone. | |
region | text | The AWS Region in which the resource is located. | |
requester_managed | boolean | Indicates whether the VPC endpoint is being managed by its service. | |
route_table_ids | jsonb | One or more route tables associated with the endpoint. | |
service_name | text | = | The name of the service to which the endpoint is associated. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | = | The state of the VPC endpoint. |
subnet_ids | jsonb | One or more subnets in which the endpoint is located. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags assigned to the VPC endpoint. | |
title | text | Title of the resource. | |
vpc_endpoint_id | text | = | The ID of the VPC endpoint. |
vpc_endpoint_type | text | The type of endpoint. | |
vpc_id | text | = | The ID of the VPC to which the endpoint is associated. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_vpc_endpoint