Table: aws_vpc_nat_gateway_metric_bytes_out_to_destination - Query AWS CloudWatch NAT Gateway Metrics using SQL
The AWS NAT Gateway is a service that enables instances in a private subnet to connect to the internet or other AWS services, but prevents the internet from initiating a connection with those instances. It offers high availability and bandwidth, allowing you to operate your workloads with predictable and reliable connectivity. The CloudWatch NAT Gateway Metrics provides detailed monitoring for the data processed by the NAT gateway.
Table Usage Guide
The aws_vpc_nat_gateway_metric_bytes_out_to_destination
table in Steampipe provides you with information about the NAT Gateway metrics within AWS CloudWatch. This table allows you, as a DevOps engineer, to query the number of bytes sent out to the destination per NAT gateway in a VPC. You can utilize this table to gather insights on network traffic, such as the volume of data sent to the destination, to monitor the performance and health of the NAT Gateways. The schema outlines the various attributes of the NAT Gateway metrics, including the NAT Gateway ID, timestamp, region, and associated tags.
The aws_vpc_nat_gateway_metric_bytes_out_to_destination
table provides you with metric statistics at 5 minute intervals for the most recent 5 days.
Examples
Basic info
Identify instances where the amount of data sent through your network gateway varies significantly. This allows you to analyze network traffic patterns and optimize your AWS VPC NAT gateway usage.
select nat_gateway_id, timestamp, minimum, maximum, average, sample_countfrom aws_vpc_nat_gateway_metric_bytes_out_to_destinationorder by nat_gateway_id, timestamp;
select nat_gateway_id, timestamp, minimum, maximum, average, sample_countfrom aws_vpc_nat_gateway_metric_bytes_out_to_destinationorder by nat_gateway_id, timestamp;
Show unused NAT gateways
Explore which NAT gateways within your AWS VPC are not being utilized. This is useful for identifying and eliminating unnecessary costs associated with maintaining unused resources.
select g.nat_gateway_id, vpc_id, subnet_idfrom aws_vpc_nat_gateway as g left join aws_vpc_nat_gateway_metric_bytes_out_to_destination as d on g.nat_gateway_id = d.nat_gateway_idgroup by g.nat_gateway_id, vpc_id, subnet_idhaving sum(average) = 0;
select g.nat_gateway_id, vpc_id, subnet_idfrom aws_vpc_nat_gateway as g left join aws_vpc_nat_gateway_metric_bytes_out_to_destination as d on g.nat_gateway_id = d.nat_gateway_idgroup by g.nat_gateway_id, vpc_id, subnet_idhaving sum(average) = 0;
Schema for aws_vpc_nat_gateway_metric_bytes_out_to_destination
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
average | double precision | The average of the metric values that correspond to the data point. | |
maximum | double precision | The maximum metric value for the data point. | |
metric_name | text | The name of the metric. | |
minimum | double precision | The minimum metric value for the data point. | |
namespace | text | The metric namespace. | |
nat_gateway_id | text | The ID of the NAT gateway. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sample_count | double precision | The number of metric values that contributed to the aggregate value of this data point. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
sum | double precision | The sum of the metric values for the data point. | |
timestamp | timestamp with time zone | The time stamp used for the data point. | |
unit | text | The standard unit for the data point. |
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_nat_gateway_metric_bytes_out_to_destination