
Simply put, network address translation (nat) converts a private IP address such as 10.14.115.25 to a public IP address. In Amazon Web Services (AWS) parlance, a public IP address is known as an Elastic IP. Check out my article Amazon Web Services (AWS) - List Elastic IP addresses using the AWS CLI.
Typically, network address translation is done by a router or modem on the edge of your network for traffic between an external system (e.g. from the Internet) and your internal private network.
This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.
The aws ec2 describe-nat-gateways command can be used to list your Network Address Translation (NAT) Gateways.
aws ec2 describe-nat-gateways
And here is an example of how to limit the output using the --query option.
aws ec2 describe-nat-gateways --query 'NatGateways[?VpcId==`vpc-0a9d4cb29e2748444`]'
Something like this should be returned.
{
"NatGateways": [
{
"NatGatewayAddresses": [
{
"NetworkInterfaceId": "eni-0bbe1c473e6dd4187",
"AllocationId": "eipalloc-01210b373d7d1d6d4",
"PrivateIp": "10.0.0.4"
}
],
"VpcId": "vpc-0a9d4cb29e2748444",
"Tags": [],
"State": "available",
"NatGatewayId": "nat-01ec189852d67de0a",
"SubnetId": "subnet-02b9845e7366bdf89",
"CreateTime": "2024-02-27T02:01:21.000Z"
}
]
}
Did you find this article helpful?
If so, consider buying me a coffee over at