Skip to main content

vpc_peerings

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

Overview

Namevpc_peerings
TypeResource
Iddigitalocean.vpcs.vpc_peerings

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called vpc_peering. The value of this will be an object that contains the standard attributes associated with a VPC peering.

NameDatatypeDescription
idstring (uuid)A unique ID that can be used to identify and reference the VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4)
namestringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes. (pattern: ^[a-zA-Z0-9-]+$, example: nyc1-blr1-peering)
created_atstring (date-time)A time value given in ISO8601 combined date and time format. (example: 2020-03-13T19:20:47.442049222Z)
statusstringThe current status of the VPC peering. (example: ACTIVE)
vpc_idsarrayAn array of the two peered VPCs IDs.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
vpc_peerings_getselectvpc_peering_idTo show information about an existing VPC Peering, send a GET request to /v2/vpc_peerings/$VPC_PEERING_ID.
vpc_peerings_listselectper_page, page, regionTo list all of the VPC peerings on your account, send a GET request to /v2/vpc_peerings.
vpc_peerings_createinsertdata__name, data__vpc_idsTo create a new VPC Peering, send a POST request to /v2/vpc_peerings
specifying a name and a list of two VPC IDs to peer. The response code, 202
Accepted, does not indicate the success or failure of the operation, just
that the request has been accepted for processing.
vpc_peerings_patchupdatevpc_peering_id, data__nameTo update the name of a VPC peering, send a PATCH request to /v2/vpc_peerings/$VPC_PEERING_ID with the new name in the request body.
vpc_peerings_deletedeletevpc_peering_idTo delete a VPC peering, send a DELETE request to /v2/vpc_peerings/$VPC_PEERING_ID.

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
vpc_peering_idstring (uuid)A unique identifier for a VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)
regionstringThe slug identifier for the region where the resource is available.

SELECT examples

To show information about an existing VPC Peering, send a GET request to /v2/vpc_peerings/$VPC_PEERING_ID.

SELECT
id,
name,
created_at,
status,
vpc_ids
FROM digitalocean.vpcs.vpc_peerings
WHERE vpc_peering_id = '{{ vpc_peering_id }}' -- required;

INSERT examples

To create a new VPC Peering, send a POST request to /v2/vpc_peerings
specifying a name and a list of two VPC IDs to peer. The response code, 202
Accepted, does not indicate the success or failure of the operation, just
that the request has been accepted for processing.

INSERT INTO digitalocean.vpcs.vpc_peerings (
data__name,
data__vpc_ids
)
SELECT
'{{ name }}' --required,
'{{ vpc_ids }}' --required
RETURNING
vpc_peering
;

UPDATE examples

To update the name of a VPC peering, send a PATCH request to /v2/vpc_peerings/$VPC_PEERING_ID with the new name in the request body.

UPDATE digitalocean.vpcs.vpc_peerings
SET
data__name = '{{ name }}'
WHERE
vpc_peering_id = '{{ vpc_peering_id }}' --required
AND data__name = '{{ name }}' --required
RETURNING
vpc_peering;

DELETE examples

To delete a VPC peering, send a DELETE request to /v2/vpc_peerings/$VPC_PEERING_ID.

DELETE FROM digitalocean.vpcs.vpc_peerings
WHERE vpc_peering_id = '{{ vpc_peering_id }}' --required;