vpc_peerings
Creates, updates, deletes, gets or lists a vpc_peerings
resource.
Overview
Name | vpc_peerings |
Type | Resource |
Id | digitalocean.vpcs.vpc_peerings |
Fields
The following fields are returned by SELECT
queries:
- vpc_peerings_get
- vpc_peerings_list
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.
Name | Datatype | Description |
---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference the VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
name | string | The 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_at | string (date-time) | A time value given in ISO8601 combined date and time format. (example: 2020-03-13T19:20:47.442049222Z) |
status | string | The current status of the VPC peering. (example: ACTIVE) |
vpc_ids | array | An array of the two peered VPCs IDs. |
The response will be a JSON object with a key called vpc_peerings
. This will be set to an array of objects, each of which will contain the standard attributes associated with a VPC peering.
Name | Datatype | Description |
---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference the VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
name | string | The 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_at | string (date-time) | A time value given in ISO8601 combined date and time format. (example: 2020-03-13T19:20:47.442049222Z) |
status | string | The current status of the VPC peering. (example: ACTIVE) |
vpc_ids | array | An array of the two peered VPCs IDs. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
vpc_peerings_get | select | vpc_peering_id | To show information about an existing VPC Peering, send a GET request to /v2/vpc_peerings/$VPC_PEERING_ID . | |
vpc_peerings_list | select | per_page , page , region | To list all of the VPC peerings on your account, send a GET request to /v2/vpc_peerings . | |
vpc_peerings_create | insert | data__name , data__vpc_ids | 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. | |
vpc_peerings_patch | update | vpc_peering_id , data__name | 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. | |
vpc_peerings_delete | delete | vpc_peering_id | To 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.
Name | Datatype | Description |
---|---|---|
vpc_peering_id | string (uuid) | A unique identifier for a VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
region | string | The slug identifier for the region where the resource is available. |
SELECT
examples
- vpc_peerings_get
- vpc_peerings_list
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;
To list all of the VPC peerings on your account, send a GET request to /v2/vpc_peerings
.
SELECT
id,
name,
created_at,
status,
vpc_ids
FROM digitalocean.vpcs.vpc_peerings
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND region = '{{ region }}';
INSERT
examples
- vpc_peerings_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: vpc_peerings
props:
- name: name
value: string
description: >
The name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes.
- name: vpc_ids
value: array
description: >
An array of the two peered VPCs IDs.
UPDATE
examples
- vpc_peerings_patch
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
- vpc_peerings_delete
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;