Skip to main content

peerings

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

Overview

Namepeerings
TypeResource
Iddigitalocean.vpcs.peerings

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference the VPC peering.
namestringThe name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
created_atstringA time value given in ISO8601 combined date and time format.
statusstringThe current status of the VPC peering.
vpc_idsarrayAn array of the two peered VPCs IDs.

Methods

NameAccessible byRequired ParamsDescription
vpcs_list_peeringsSELECTvpc_idTo list all of a VPC's peerings, send a GET request to /v2/vpcs/$VPC_ID/peerings.
vpcs_create_peeringsINSERTvpc_id, data__name, data__vpc_idTo create a new VPC peering for a given VPC, send a POST request to /v2/vpcs/$VPC_ID/peerings.
vpcs_patch_peeringsUPDATEvpc_id, vpc_peering_idTo update the name of a VPC peering in a particular VPC, send a PATCH request to /v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID with the new name in the request body.

SELECT examples

To list all of a VPC's peerings, send a GET request to /v2/vpcs/$VPC_ID/peerings.

SELECT
id,
name,
created_at,
status,
vpc_ids
FROM digitalocean.vpcs.peerings
WHERE vpc_id = '{{ vpc_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new peerings resource.

/*+ create */
INSERT INTO digitalocean.vpcs.peerings (
data__name,
data__vpc_id,
vpc_id
)
SELECT
'{{ name }}',
'{{ vpc_id }}'
;

UPDATE example

Updates a peerings resource.

/*+ update */
UPDATE digitalocean.vpcs.peerings
SET
name = '{{ name }}'
WHERE
vpc_id = '{{ vpc_id }}'
AND vpc_peering_id = '{{ vpc_peering_id }}';