Skip to content

Create a VPC

client.projects.vpcs.create(stringprojectID, VpcCreateParams { cidr, name, region_code } body, RequestOptionsoptions?): Vpc { id, cidr, name, region_code }
POST/projects/{project_id}/vpcs

Creates a new Virtual Private Cloud (VPC).

ParametersExpand Collapse
projectID: string
body: VpcCreateParams { cidr, name, region_code }
cidr: string
name: string
region_code: string
ReturnsExpand Collapse
Vpc { id, cidr, name, region_code }
id?: string
cidr?: string
name?: string
region_code?: string

Create 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.create('rp1pz7uyae', {
  cidr: '10.0.0.0/16',
  name: 'my-production-vpc',
  region_code: 'us-east-1',
});

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"
}