pydo.vpcnatgateways.create()
Generated on 1 Oct 2026
from pydo version
v0.43.0
Usage
client.vpcnatgateways.create(
body={
"name": "my-vpc-nat-gateway",
"type": "PUBLIC",
"region": "tor1",
...,
},
)Description
To create a new VPC NAT gateway, send a POST request to /v2/vpc_nat_gateways setting the required attributes.
The response body will contain a JSON object with a key called vpc_nat_gateway containing the standard attributes for the new VPC NAT gateway.
Parameters
namestring requiredExample:
my-vpc-nat-gatewayThe human-readable name of the VPC NAT gateway.
typestring requiredExample:
PUBLICThe type of the VPC NAT gateway.
regionstring requiredThe region in which the VPC NAT gateway is created.
sizeinteger requiredExample:
1The size of the VPC NAT gateway.
vpcsarray of objects requiredAn array of VPCs associated with the VPC NAT gateway.
Show child properties
vpc_uuidstring requiredExample:
0d3db13e-a604-4944-9827-7ec2642d32acThe unique identifier of the VPC to which the NAT gateway is attached.
subnet_uuidstring optionalExample:
cbd79771-23eb-49be-b5ea-59cc56222622The unique identifier of the VPC subnet to which the NAT gateway is attached.
default_gatewayboolean optionalExample:
TrueThe classification of the NAT gateway as the default egress route for the VPC traffic.
udp_timeout_secondsinteger optionalExample:
30The UDP timeout in seconds for the VPC NAT gateway.
icmp_timeout_secondsinteger optionalExample:
30The ICMP timeout in seconds for the VPC NAT gateway.
tcp_timeout_secondsinteger optionalExample:
30The TCP timeout in seconds for the VPC NAT gateway.
egressesobject optionalAn optional object specifying the public egress IP address to assign to the VPC NAT gateway. Provide this only to use a specific address. If omitted, DigitalOcean allocates a public IP address automatically.
Show child properties
public_gatewaysarray of objects optionalAn array containing a single public gateway object that sets the gateway's public egress IP address.
Show child properties
ipstring optionalExample:
203.0.113.42The public egress IP address to assign to the VPC NAT gateway, and the preferred field for setting it. Provide an unassigned Bring Your Own IP (BYOIP) address on your account in the same region to use your own IP address. This field is only applied when creating the gateway and cannot be changed afterward. The assigned address is returned as
ipv4in GET and list responses.ipv4string optionalExample:
203.0.113.42An alternative to
ipfor setting the public egress IP address on create. Accepts the same value asip, which takes precedence if both are provided. This field is only applied when creating the gateway and cannot be changed afterward.
Request Sample
Response Example
More Information
See /v2/vpc_nat_gateways in the API reference for additional detail on responses, headers, parameters, and more.