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. (example: tor1)
sizeintegerThe size of the VPC NAT gateway.
statestringThe current state of the VPC NAT gateway. (example: ACTIVE)
tcp_timeout_secondsintegerThe TCP timeout in seconds for the VPC NAT gateway.
typestringThe type of the VPC NAT gateway. (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_createinsertdata__name, data__type, data__region, data__size, data__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, data__name, data__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 (
data__name,
data__type,
data__region,
data__size,
data__vpcs,
data__udp_timeout_seconds,
data__icmp_timeout_seconds,
data__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
data__name = '{{ name }}',
data__size = {{ size }},
data__udp_timeout_seconds = {{ udp_timeout_seconds }},
data__icmp_timeout_seconds = {{ icmp_timeout_seconds }},
data__tcp_timeout_seconds = {{ tcp_timeout_seconds }}
WHERE
id = '{{ id }}' --required
AND data__name = '{{ name }}' --required
AND data__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;