pydo.vpcs.create_peerings()

Generated on 9 Jun 2026 from pydo version v0.36.0

Usage

client.vpcs.create_peerings(
    vpc_id="4de7ac8b-495b-4884-9a69-1050c6793cd6",
    body={
        "name": "nyc1-blr1-peering",
        "vpc_id": "c140286f-e6ce-4131-8b7b-df4590ce8d6a",
    },
)
Returns JSONRaises HttpResponseError

Description

To create a new VPC peering for a given VPC, send a POST request to /v2/vpcs/{vpc_id}/peerings.

Parameters

vpc_id string required

A unique identifier for a VPC.

Min: 1

name string required

Example: nyc1-blr1-peering

The name of the VPC peering. Must be unique and may only contain alphanumeric characters, dashes, and periods.

vpc_id string required

Example: c140286f-e6ce-4131-8b7b-df4590ce8d6a

The ID of the VPC to peer with.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "nyc1-blr1-peering",
  "vpc_id": "c140286f-e6ce-4131-8b7b-df4590ce8d6a"
}

resp = client.vpcs.create_peerings(vpc_id="4de7ac8b-495b-4884-9a69-1050c6793cd6", body=req)

Response Example

Show Response Example
{
  "peering": {
    "id": "6b5c619c-359c-44ca-87e2-47e98170c01d",
    "name": "example-vpc-peering",
    "vpc_ids": [
      "997615ce-132d-4bae-9270-9ee21b395e5d",
      "e51aed59-3bb1-4a6a-8de0-9d1329e9c997"
    ],
    "created_at": "2024-01-09T20:44:32Z",
    "status": "PROVISIONING"
  }
}

More Information

See /v2/vpcs/{vpc_id}/peerings in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.