Creates a NAT gateway in the specified subnet. This action creates a network interface
in the specified subnet with a private IP address from the IP address range of the
subnet. You can create either a public NAT gateway or a private NAT gateway.
With a public NAT gateway, internet-bound traffic from a private subnet can be routed
to the NAT gateway, so that instances in a private subnet can connect to the internet.
With a private NAT gateway, private communication is routed across VPCs and on-premises
networks through a transit gateway or virtual private gateway. Common use cases include
running large workloads behind a small pool of allowlisted IPv4 addresses, preserving
private IPv4 addresses, and communicating between overlapping networks.
For more information, see NAT gateways in the Amazon Virtual Private Cloud User Guide.
example
Use a bare-bones client and the command you need to make an API call.
Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or a private NAT gateway.
With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that instances in a private subnet can connect to the internet.
With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks.
For more information, see NAT gateways in the Amazon Virtual Private Cloud User Guide.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, CreateNatGatewayCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, CreateNatGatewayCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new CreateNatGatewayCommand(input); const response = await client.send(command);
CreateNatGatewayCommandInput for command's
input
shape.CreateNatGatewayCommandOutput for command's
response
shape.config for EC2Client's
config
shape.