Skip to content

Create a VPC Peering

client.projects.vpcs.peerings.create(stringvpcID, PeeringCreateParams { project_id, peer_account_id, peer_region_code, peer_vpc_id } params, RequestOptionsoptions?): Peering { id, error_message, peer_account_id, 4 more }
POST/projects/{project_id}/vpcs/{vpc_id}/peerings

Creates a new VPC peering connection.

ParametersExpand Collapse
vpcID: string
params: PeeringCreateParams { project_id, peer_account_id, peer_region_code, peer_vpc_id }
project_id: string

Path param: The unique identifier of the project.

peer_account_id: string

Body param

peer_region_code: string

Body param

peer_vpc_id: string

Body param

ReturnsExpand Collapse
Peering { id, error_message, peer_account_id, 4 more }
id?: string
error_message?: string
peer_account_id?: string
peer_region_code?: string
peer_vpc_id?: string
provisioned_id?: string
status?: string

Create a VPC Peering

import TigerCloud from 'tiger-cloud';

const client = new TigerCloud({
  apiKey: process.env['TIGER_CLOUD_API_KEY'], // This is the default and can be omitted
});

const peering = await client.projects.vpcs.peerings.create('1234567890', {
  project_id: 'rp1pz7uyae',
  peer_account_id: 'acc-12345',
  peer_region_code: 'aws-us-east-1',
  peer_vpc_id: '1234567890',
});

console.log(peering.id);
{
  "id": "1234567890",
  "error_message": "VPC not found",
  "peer_account_id": "acc-12345",
  "peer_region_code": "aws-us-east-1",
  "peer_vpc_id": "1234567890",
  "provisioned_id": "1234567890",
  "status": "active"
}
Returns Examples
{
  "id": "1234567890",
  "error_message": "VPC not found",
  "peer_account_id": "acc-12345",
  "peer_region_code": "aws-us-east-1",
  "peer_vpc_id": "1234567890",
  "provisioned_id": "1234567890",
  "status": "active"
}