The natgateway metricset of aws module allows users to monitor NAT gateway services.
NAT gateway metric data can be used to monitor and troubleshoot NAT gateways and
the data is provided at 1-minute intervals to CloudWatch.
Users can use these metrics to gain a better perspective on how the web application or
service is performing.

[float]
=== AWS Permissions
Some specific AWS permissions are required for IAM user to collect usage metrics.
----
ec2:DescribeRegions
cloudwatch:GetMetricData
cloudwatch:ListMetrics
tag:getResources
sts:GetCallerIdentity
iam:ListAccountAliases
----

[float]
=== Dashboard

The aws natgateway metricset comes with a predefined dashboard. For example:

image::./images/metricbeat-aws-natgateway-overview.png[]

[float]
=== Configuration example
[source,yaml]
----
- module: aws
  period: 1m
  metricsets:
    - natgateway
  # This module uses the aws cloudwatch metricset, all
  # the options for this metricset are also available here.
----

[float]
=== Metrics and Dimensions for NAT gateway
Metrics:
|===
|Metric Name|Statistic Method | Description
|ActiveConnectionCount | Max | The total number of concurrent active TCP connections through the NAT gateway.
|BytesInFromDestination | Sum | The number of bytes received by the NAT gateway from the destination.
|BytesInFromSource | Sum | The number of bytes received by the NAT gateway from clients in your VPC.
|BytesOutToDestination | Sum | The number of bytes sent out through the NAT gateway to the destination.
|BytesOutToSource | Sum | The number of bytes sent through the NAT gateway to the clients in your VPC.
|ConnectionAttemptCount | Sum | The number of connection attempts made through the NAT gateway.
|ConnectionEstablishedCount | Sum | The number of connections established through the NAT gateway.
|ErrorPortAllocation | Sum | The number of times the NAT gateway could not allocate a source port.
|IdleTimeoutCount | Sum | The number of connections that transitioned from the active state to the idle state.
|PacketsDropCount | Sum | The number of packets dropped by the NAT gateway.
|PacketsInFromDestination | Sum | The number of packets received by the NAT gateway from the destination.
|PacketsInFromSource | Sum | The number of packets received by the NAT gateway from clients in your VPC.
|PacketsOutToDestination | Sum | The number of packets sent out through the NAT gateway to the destination.
|PacketsOutToSource | Sum | The number of packets sent through the NAT gateway to the clients in your VPC.
|===

Dimensions:
|===
|Dimension Name| Description
|NatGatewayId | Filter the metric data by the NAT gateway ID.
|===

Please see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway-cloudwatch.html[NAT Gateway CloudWatch Metrics] for more details.
