LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

doctl-vpcs

manage DigitalOcean VPC networks

TLDR

List VPC networks
$ doctl vpcs list
copy
Create a VPC in a region
$ doctl vpcs create --name [example-vpc] --region [nyc1]
copy
Create a VPC with an explicit CIDR range
$ doctl vpcs create --name [example-vpc] --region [nyc1] --ip-range [10.116.0.0/20]
copy
Show a VPC
$ doctl vpcs get [vpc-id]
copy
Rename a VPC and make it the regional default
$ doctl vpcs update [vpc-id] --name [new-name] --default=true
copy
Delete a VPC
$ doctl vpcs delete [vpc-id]
copy

SYNOPSIS

doctl vpcs command [arguments] [options]

DESCRIPTION

doctl vpcs manages Virtual Private Cloud networks on DigitalOcean. A VPC is a private IPv4 network in a single region. Droplets, load balancers, databases, and Kubernetes nodes in the same VPC can communicate over private addresses without traversing the public internet.create needs a name and region. If --ip-range is omitted, DigitalOcean assigns a range. update --default=true makes the VPC the default for new resources in that region. delete is irreversible and refuses to remove a region's default VPC until another network is marked default.peerings is a nested command group for connecting two VPCs so their private ranges can route to each other.

PARAMETERS

list, ls

List VPC networks on the account.
create, c
Create a VPC. Requires --name and --region.
get, g vpc-id
Retrieve a VPC network.
update, u vpc-id
Update name, description, or default state.
delete, d, rm vpc-id
Permanently delete a VPC.
peerings
Manage VPC peerings between networks.
--name NAME
VPC name (required for create).
--region SLUG
Datacenter region slug such as `nyc1` (required for create).
--ip-range CIDR
IPv4 range in CIDR notation (for example `10.116.0.0/20`). Generated if omitted.
--description TEXT
Human-readable description.
--default
When updating, mark this VPC as the default network for its region.
-f, --force
Skip the confirmation prompt on delete.
--output FORMAT
Output format: `text` or `json`.
--help, -h
Display help for this command.

INSTALL

sudo dnf install doctl
copy
sudo pacman -S doctl
copy
sudo apk add doctl
copy
brew install doctl
copy
nix profile install nixpkgs#doctl
copy

CAVEATS

Requires a DigitalOcean API token. You cannot delete a region's default VPC until another VPC is set as default. Resources still attached to a VPC block deletion. IP ranges cannot be changed after create. VPC traffic stays inside one region unless you add a peering or a gateway.

SEE ALSO

RESOURCES

Copied to clipboard
Kai