> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create custom VPC

> POST /v2/api/create_custom_vpc



## OpenAPI

````yaml /openapi/8.2/aviatrix-api.json post /v2/api/create_custom_vpc
openapi: 3.1.0
info:
  title: Aviatrix Controller API
  version: '8.2'
  description: >-
    Aviatrix Controller API — version 8.2. Selected operations with Mintlify
    metadata.
servers: []
security: []
tags:
  - name: policies
    x-group: Policies
  - name: authentication
    x-group: Authentication
  - name: account-management
    x-group: Account Management
  - name: rbac
    x-group: RBAC & Permissions
  - name: gateways
    x-group: Gateways
  - name: transit
    x-group: Transit
  - name: nat
    x-group: NAT
  - name: app-domains
    x-group: SmartGroups
  - name: certificates
    x-group: Certificates
  - name: mitm
    x-group: MITM
  - name: monitoring
    x-group: Monitoring & Diagnostics
  - name: fqdn
    x-group: FQDN
  - name: logging
    x-group: Logging
  - name: vpn
    x-group: UserVPN
  - name: site-to-cloud
    x-group: Site-to-Cloud
  - name: controller
    x-group: Controller
  - name: bgp
    x-group: BGP
  - name: general
    x-group: General
  - name: firenet
    x-group: FireNet
  - name: networking
    x-group: Networking
  - name: tgw
    x-group: AWS TGW
  - name: ips
    x-group: IPS
  - name: saml
    x-group: SAML
paths:
  /v2/api/create_custom_vpc:
    post:
      tags:
        - networking
      operationId: create_custom_vpc
      requestBody:
        content:
          application/json:
            schema:
              properties:
                CID:
                  $ref: '#/components/schemas/CID'
                account_name:
                  description: AWS account name.
                  type: string
                action:
                  $ref: '#/components/schemas/action'
                add_gateway:
                  $ref: '#/components/schemas/StringToggle'
                  description: Launch a gateway for each VPC in the pool.
                aviatrix_firenet_vpc:
                  description: Aviatrix FireNet VPC.
                  type: boolean
                aviatrix_transit_vpc:
                  description: Aviatrix Transit VPC.
                  type: boolean
                cloud_type:
                  description: Cloud type.
                  enum:
                    - 1
                    - 4
                    - 8
                    - 16
                    - 32
                    - 256
                    - 1024
                    - 2048
                    - 8192
                  type: integer
                designated_gateway:
                  description: This gateway is used as Designated routing gateway.
                  type: boolean
                enable_ipv6:
                  description: Enable ipv6 for the VPC.
                  type: boolean
                enable_nat:
                  $ref: '#/components/schemas/StringToggle'
                  description: Enable NAT for launched gateway.
                ipv6_access_type:
                  description: >-
                    (GCP only) IPv6 access type. EXTERNAL: Google auto-allocates
                    public IPv6. INTERNAL: Use ULA (Unique Local Address) IPv6
                    range.
                  enum:
                    - EXTERNAL
                    - INTERNAL
                  type: string
                log_file:
                  description: Full path of the progress log file.
                  type: string
                num_of_subnets:
                  description: Pairs of public and private subnets to create.
                  type: string
                num_of_vpc:
                  description: Number of VPCs to create in the pool.
                  type: string
                num_of_zones:
                  description: Number of availability zones to create subnet.
                  type: string
                pool_name:
                  description: A unique vpc name prefix .
                  type: string
                private_oob_subnets:
                  description: Create private management subnets.
                  type: boolean
                public_subnets:
                  description: >-
                    If this VPC should have public subnets. Default is yes.
                    Enter no if you do not allow.
                  type: string
                region:
                  description: A vpc region.
                  type: string
                resource_group:
                  description: Azure resource group.
                  type: string
                security_url:
                  description: >-
                    List of S3 url scripts in CloudFormation format to apply to
                    this VPC. Use | to separate urls. Use profile_default if you
                    are not sure.
                  type: string
                subnet_bit_length:
                  description: Number of bits to be used as subnet.
                  type: string
                subnet_list:
                  description: List of subnets to be added.
                  type: string
                subnet_size:
                  description: VPC subnet size.
                  type: string
                vpc_cidr:
                  description: Vpc_cidr.
                  type: string
                vpc_ipv6_cidr:
                  description: >-
                    IPv6 CIDR block for the VPC/VNet. Required for Azure when
                    IPv6 is enabled. For GCP INTERNAL access type, this
                    specifies the custom ULA range (e.g., fd00::/48).
                  type: string
                vpc_size:
                  description: Instance size of vpc cloudx.
                  type: string
              required:
                - pool_name
                - account_name
                - vpc_cidr
                - cloud_type
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/general_response_v2'
        default:
          $ref: '#/components/responses/general_response_v2'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -sk -X POST "https://<controller>/v2/api/create_custom_vpc" \
              -H "Authorization: cid <CID>"
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://<controller>/v2/api/create_custom_vpc"
            headers = {"Authorization": "cid <CID>"}

            response = requests.post(url, headers=headers, verify=False)
            print(response.status_code)
            print(response.text)
        - lang: javascript
          label: JavaScript
          source: |-
            fetch("https://<controller>/v2/api/create_custom_vpc", {
              method: "POST",
              headers: {"Authorization": "cid <CID>"}
            })
              .then(res => res.text())
              .then(console.log)
              .catch(console.error);
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
            )

            func main() {
              req, _ := http.NewRequest("POST", "https://<controller>/v2/api/create_custom_vpc", nil)
              req.Header.Set("Authorization", "cid <CID>")

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              fmt.Println(resp.Status)
            }
components:
  schemas:
    CID:
      description: The opaque session ID token. Required for 7.2 controllers only.
      type: string
    action:
      description: The API action to perform. Required for 7.2 controllers only.
      type: string
    StringToggle:
      description: A boolean choice expressed as a string
      enum:
        - 'yes'
        - 'no'
      type: string
    general_response_v2:
      additionalProperties: true
      description: A generic API response container for v2 style APIs.
      properties:
        errortype:
          description: Error type if the API failed.
          type: string
        reason:
          description: Failure reason if the API failed.
          type: string
        results:
          oneOf:
            - description: API response data
              type: boolean
            - description: API response data
              type: integer
            - description: API response data
              type: string
            - description: API response data
              type: object
            - description: API response data
              items: {}
              type: array
        return:
          description: Whether the API returned successfully
          type: boolean
      title: General Response v2
      type: object
  responses:
    general_response_v2:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/general_response_v2'
      description: General v2 API response schema.

````