Skip to content

Get a VPC

client.projects.vpcs.retrieve(stringvpcID, VpcRetrieveParams { project_id } params, RequestOptionsoptions?): Vpc { id, cidr, name, region_code }
GET/projects/{project_id}/vpcs/{vpc_id}

Retrieves the details of a specific VPC by its ID.

ParametersExpand Collapse
vpcID: string
params: VpcRetrieveParams { project_id }
project_id: string

The unique identifier of the project.

ReturnsExpand Collapse
Vpc { id, cidr, name, region_code }
id?: string
cidr?: string
name?: string
region_code?: string

Get a VPC

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 vpc = await client.projects.vpcs.retrieve('1234567890', { project_id: 'rp1pz7uyae' });

console.log(vpc.id);
{
  "id": "1234567890",
  "cidr": "10.0.0.0/16",
  "name": "my-production-vpc",
  "region_code": "us-east-1"
}
Returns Examples
{
  "id": "1234567890",
  "cidr": "10.0.0.0/16",
  "name": "my-production-vpc",
  "region_code": "us-east-1"
}