v1

latestSwagger 2.02026-08-04232286653.5 KB
VPC Subnets

Creates a VPC subnet in the project and returns the created subnet.

post/projects/{project_id}/networking/vpc-subnets

Path parameters

project_idstring required

Request body

cidrstring required

Address range for the VPC subnet, in CIDR notation (for example, 172.27.0.0/16).

locationstring required

Location to create the subnet in.

namestring required

Name for the new VPC subnet.

nat_gateway_enabledboolean required

Whether to create a NAT gateway for the subnet.

vpc_network_idstring required

ID of the VPC network to create the subnet in.

Example request

{
  "cidr": "172.27.0.0/16",
  "location": "us-east",
  "name": "my-cool-vpc-subnet",
  "nat_gateway_enabled": true,
  "vpc_network_id": "36c0b0d9-8b68-4869-addb-227b06b64ee0"
}

Response

Example response

{
  "subnet": {
    "cidr": "121.0.0.0/24",
    "id": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc",
    "location": "us-northcentraleast1-a",
    "name": "my-subnet",
    "nat_gateways": [
      {
        "id": "8f3c4b7d-3c3b-4a63-8e1a-6cd14c1dfe91",
        "public_ipv4_address": "121.0.0.0",
        "public_ipv4_id": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc"
      }
    ],
    "vpc_network_id": "1ce839b7-3fab-46f9-8e54-7a6bb4ac1ffc"
  }
}