Skip to main content

vpcs

Overview

Namevpcs
TypeResource
Iddigitalocean.vpcs.vpcs

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference the VPC.
namestringThe name of the VPC. Must be unique and may only contain alphanumeric characters, dashes, and periods.
descriptionstringA free-form text field for describing the VPC's purpose. It may be a maximum of 255 characters.
created_atstringA time value given in ISO8601 combined date and time format.
defaultbooleanA boolean value indicating whether or not the VPC is the default network for the region. All applicable resources are placed into the default VPC network unless otherwise specified during their creation. The default field cannot be unset from true. If you want to set a new default VPC network, update the default field of another VPC network in the same region. The previous network's default field will be set to false when a new default VPC has been defined.
ip_rangestringThe range of IP addresses in the VPC in CIDR notation. Network ranges cannot overlap with other networks in the same account and must be in range of private addresses as defined in RFC1918. It may not be smaller than /28 nor larger than /16. If no IP range is specified, a /20 network range is generated that won't conflict with other VPC networks in your account.
regionstringThe slug identifier for the region where the VPC will be created.
urnstringThe uniform resource name (URN) for the resource in the format do:resource_type:resource_id.

Methods

NameAccessible byRequired ParamsDescription
getSELECTvpc_idTo show information about an existing VPC, send a GET request to /v2/vpcs/$VPC_ID.
listSELECTTo list all of the VPCs on your account, send a GET request to /v2/vpcs.
createINSERTdata__name, data__regionTo create a VPC, send a POST request to /v2/vpcs specifying the attributes
in the table below in the JSON body.

Note: If you do not currently have a VPC network in a specific datacenter
region, the first one that you create will be set as the default for that
region. The default VPC for a region cannot be changed or deleted.
deleteDELETEvpc_idTo delete a VPC, send a DELETE request to /v2/vpcs/$VPC_ID. A 204 status
code with no body will be returned in response to a successful request.

The default VPC for a region can not be deleted. Additionally, a VPC can only
be deleted if it does not contain any member resources. Attempting to delete
a region's default VPC or a VPC that still has members will result in a
403 Forbidden error response.
_getEXECvpc_idTo show information about an existing VPC, send a GET request to /v2/vpcs/$VPC_ID.
_listEXECTo list all of the VPCs on your account, send a GET request to /v2/vpcs.
patchEXECvpc_idTo update a subset of information about a VPC, send a PATCH request to
/v2/vpcs/$VPC_ID.
updateEXECvpc_id, data__nameTo update information about a VPC, send a PUT request to /v2/vpcs/$VPC_ID.