Skip to main content

vpc_nat_gateways

Creates, updates, deletes, gets or lists a vpc_nat_gateways resource.

Overview

Namevpc_nat_gateways
TypeResource
Iddigitalocean.compute.vpc_nat_gateways

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called vpc_nat_gateway. This will be
set to a JSON object that contains the standard VPC NAT gateway attributes.

NameDatatypeDescription
idstringThe unique identifier for the VPC NAT gateway. This is automatically generated upon creation. (example: 70e1b58d-cdec-4e95-b3ee-2d4d95feff51)
namestringThe human-readable name of the VPC NAT gateway. (example: my-vpc-nat-gateway)
created_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the VPC NAT gateway was created. (title: The creation time of the VPC NAT gateway., example: 2020-07-28T18:00:00Z)
egressesobjectAn object containing egress information for the VPC NAT gateway.
icmp_timeout_secondsintegerThe ICMP timeout in seconds for the VPC NAT gateway.
regionstringThe region in which the VPC NAT gateway is created. (nyc1, nyc2, nyc3, ams2, ams3, sfo1, sfo2, sfo3, sgp1, lon1, fra1, tor1, blr1, syd1, atl1) (example: tor1)
sizeintegerThe size of the VPC NAT gateway.
statestringThe current state of the VPC NAT gateway. (NEW, PROVISIONING, ACTIVE, DELETING, ERROR, INVALID) (example: ACTIVE)
tcp_timeout_secondsintegerThe TCP timeout in seconds for the VPC NAT gateway.
typestringThe type of the VPC NAT gateway. (PUBLIC) (example: PUBLIC)
udp_timeout_secondsintegerThe UDP timeout in seconds for the VPC NAT gateway.
updated_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the VPC NAT gateway was last updated. (title: The last update time of the VPC NAT gateway., example: 2020-07-28T18:00:00Z)
vpcsarrayAn array of VPCs associated with the VPC NAT gateway.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
vpcnatgateways_getselectidTo show information about an individual VPC NAT gateway, send a GET request to
/v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID.
vpcnatgateways_listselectper_page, page, state, region, type, nameTo list all VPC NAT gateways in your team, send a GET request to /v2/vpc_nat_gateways.
The response body will be a JSON object with a key of vpc_nat_gateways containing an array of VPC NAT gateway objects.
These each contain the standard VPC NAT gateway attributes.
vpcnatgateways_createinsertname, type, region, size, vpcsTo 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.
vpcnatgateways_updatereplaceid, name, sizeTo update the configuration of an existing VPC NAT Gateway, send a PUT request to
/v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID. The request must contain a full representation
of the VPC NAT Gateway including existing attributes.
vpcnatgateways_deletedeleteidTo destroy a VPC NAT Gateway, send a DELETE request to the /v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID endpoint.

A successful response will include a 202 response code and no content.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe unique identifier of the VPC NAT gateway. (example: 70e1b58d-cdec-4e95-b3ee-2d4d95feff51)
namestringThe name of the VPC NAT gateway. (example: my-vpc-nat-gateway)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)
regionstringThe region where the VPC NAT gateway is located. (example: tor1)
statestringThe current state of the VPC NAT gateway. (example: active)
typestringThe type of the VPC NAT gateway. (example: public)

SELECT examples

To show information about an individual VPC NAT gateway, send a GET request to
/v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID.

SELECT
id,
name,
created_at,
egresses,
icmp_timeout_seconds,
region,
size,
state,
tcp_timeout_seconds,
type,
udp_timeout_seconds,
updated_at,
vpcs
FROM digitalocean.compute.vpc_nat_gateways
WHERE id = '{{ id }}' -- required
;

INSERT examples

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.

INSERT INTO digitalocean.compute.vpc_nat_gateways (
name,
type,
region,
size,
vpcs,
udp_timeout_seconds,
icmp_timeout_seconds,
tcp_timeout_seconds
)
SELECT
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ region }}' /* required */,
{{ size }} /* required */,
'{{ vpcs }}' /* required */,
{{ udp_timeout_seconds }},
{{ icmp_timeout_seconds }},
{{ tcp_timeout_seconds }}
RETURNING
vpc_nat_gateway
;

REPLACE examples

To update the configuration of an existing VPC NAT Gateway, send a PUT request to
/v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID. The request must contain a full representation
of the VPC NAT Gateway including existing attributes.

REPLACE digitalocean.compute.vpc_nat_gateways
SET
name = '{{ name }}',
size = {{ size }},
vpcs = '{{ vpcs }}',
udp_timeout_seconds = {{ udp_timeout_seconds }},
icmp_timeout_seconds = {{ icmp_timeout_seconds }},
tcp_timeout_seconds = {{ tcp_timeout_seconds }}
WHERE
id = '{{ id }}' --required
AND name = '{{ name }}' --required
AND size = '{{ size }}' --required
RETURNING
vpc_nat_gateway;

DELETE examples

To destroy a VPC NAT Gateway, send a DELETE request to the /v2/vpc_nat_gateways/$VPC_NAT_GATEWAY_ID endpoint.

A successful response will include a 202 response code and no content.

DELETE FROM digitalocean.compute.vpc_nat_gateways
WHERE id = '{{ id }}' --required
;