---
schema_version: "1"
id: ccfdd5ed4f8cca7ea4680939d00d9d960858595b7b6619a4a9e86178395174d1
title: CLI for Anypoint Virtual Private Cloud
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-cli/3.x/cloudhub-vpc.md
canonical_url: https://docs.mulesoft.com/anypoint-cli/3.x/cloudhub-vpc
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8bb4e16a91d4efea5041fcb503bb34e78adc7a4c01d58c587ee41717171a161c
description: MuleSoft Documentation Site
release: 3.x
latest: false
---
---
product: Anypoint CLI
version: 3.x
---

# CLI for Anypoint Virtual Private Cloud

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

<table><colgroup><col> <col></colgroup><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><a href="#cloudhub-vpc-list">cloudhub vpc list</a></p></div></div></td><td><div><div><p>Lists all Anypoint VPCs</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-describe">cloudhub vpc describe</a></p></div></div></td><td><div><div><p>Show Anypoint VPC details</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-describe-json">cloudhub vpc describe-json</a></p></div></div></td><td><div><div><p>Show raw Anypoint VPC JSON response</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-create">cloudhub vpc create</a></p></div></div></td><td><div><div><p>Create a new Anypoint VPC</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-delete">cloudhub vpc delete</a></p></div></div></td><td><div><div><p>Delete an existing Anypoint VPC</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-environments-add">cloudhub vpc environments add</a></p></div></div></td><td><div><div><p>Modifies the Anypoint VPC association to Runtime Manager environments.</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-environments-remove">cloudhub vpc environments remove</a></p></div></div></td><td><div><div><p>Modifies the Anypoint VPC association to Runtime Manager environments.</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-business-groups-add">cloudhub vpc business-groups add</a></p></div></div></td><td><div><div><p>Share an Anypoint VPC with a list of Business Groups.</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-business-groups-remove">cloudhub vpc business-groups remove</a></p></div></div></td><td><div><div><p>Share an Anypoint VPC with a list of Business Groups.</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-dns-servers-set">cloudhub vpc dns-servers set</a></p></div></div></td><td><div><div><p>Sets the domain names that are resolved using your internal DNS servers. If used with no option, internal DNS will be disabled</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-dns-servers-unset">cloudhub vpc dns-servers unset</a></p></div></div></td><td><div><div><p>Clears the list domain names that are resolved using your internal DNS servers</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-firewall-rules-describe">cloudhub vpc firewall-rules describe</a></p></div></div></td><td><div><div><p>Show firewall rule for Mule applications in this Anypoint VPC</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-firewall-rules-add">cloudhub vpc firewall-rules add</a></p></div></div></td><td><div><div><p>Add a firewall rule for Mule applications in this Anypoint VPC</p></div></div></td></tr><tr><td><div><div><p><a href="#cloudhub-vpc-firewall-rules-remove">cloudhub vpc firewall-rules remove</a></p></div></div></td><td><div><div><p>Remove a firewall rule for Mule applications in this Anypoint VPC</p></div></div></td></tr></tbody></table>

## cloudhub vpc list

\> cloudhub VPC list \[options\]

This command lists all available Anypoint VPCs. It returns ID, region, and environment of the
network and whether it is the default Anypoint VPC or not.

## cloudhub vpc describe

\> cloudhub vpc describe \[options\] <name>

This command displays information about the Anypoint VPC that is specified in `<name>`.

You can start typing your Anypoint VPC’s name and press `tab` for Anypoint Platform CLI to
autocomplete it, or you can double tap `tab` for a full list of all the values you can pass.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc describe-json

\> cloudhub vpc describe \[options\] <name>

This command displays a raw JSON response of the Anypoint VPC that is specified in `<name>`.

You can start typing your Anypoint VPC’s name and press `tab` for Anypoint Platform CLI to
autocomplete it, or you can double tap `tab` for a full list of all the values you can pass.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc create

\> cloudhub vpc create \[options\] <name> <region> <cidrBlock> \[environments...\]

This command creates an Anypoint VPC using the name in `<name>`, in the region specified in
`<region>`, with the [size](https://docs.mulesoft.com/cloudhub/vpc-provisioning-concept#faq_how_to_size_vpc) passed in
`<cidrBlock>` in the form of a Classless Inter-Domain Routing (CIDR) block, using
[CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#IPv4_CIDR_blocks) and
associates it to the [environments](https://docs.mulesoft.com/access-management/environments) passed as argument(s)
thereafter.

> [!NOTE] An Anypoint VPC needs to be bound to a business group within your organization. When
> creating an Anypoint VPC, make sure to assign it a business group using the
> [business-groups add](#cloudhub-vpc-business-groups-add) command.

Besides the default `--help` option, this command also takes the `--default` option. When passed,
the Anypoint VPC is created as the default Anypoint VPC for the selected environment.

## cloudhub vpc delete

\> cloudhub vpc delete <name>

This command deletes the Anypoint VPC specified in `<name>`.

> [!WARNING] This command does not prompt twice before deleting. If you send a delete instruction,
> it does not ask for confirmation.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc environments add

\> cloudhub vpc environments add \[options\] <vpc> \[environments...\]

This command assigns the Anypoint VPC defined in `<vpc>` to the environment(s) passed as argument(s)
thereafter.  
The `--default` option allows setting an Anypoint VPC as the default for the organization, which
applies to all environments which don’t have an Anypoint VPC explicitly associated.

This command also takes the default `--help` option.

## cloudhub vpc environments remove

\> cloudhub vpc environments remove \[options\] <vpc> \[environments...\]

This command removes the Anypoint VPC defined in `<vpc>` from the environment(s) passed as
argument(s) thereafter.  
Besides the default `--help` option, this command also takes the option `--default`, that removes
this Anypoint VPC as the default Anypoint VPC for the environment.

## cloudhub vpc business-groups add

\> cloudhub vpc business-groups add \[options\] <vpc> <businessGroups...>

This command assigns the Anypoint VPC defined in `<vpc>` to the business group(s) passed as
argument(s) thereafter.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc business-groups remove

\> cloudhub vpc business-groups remove \[options\] <vpc> <businessGroups...>

This command removes the Anypoint VPC defined in `<vpc>` from the business group(s) passed as
argument(s) thereafter

> [!WARNING] This command does not prompt twice before removing the Anypoint VPC from the specified
> resource. If you send a remove instruction, it does not ask for confirmation.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc dns-servers set

\> cloudhub vpc dns-servers set \[options\] <vpc>

This command sets a list of local host names (internal domain names) to be resolved using your DNS
servers for which you need to provide their IP addresses (whether private or public addresses).  
Whenever those private domains are provided, your worker resolves them using your private DNS, so
you can still use the internal host names of your private network.

> [!NOTE] This feature is supported by workers running Mule versions 3.5.x, 3.6.x, 3.7.4, 3.8.0-HF1,
> 3.8.1 and 3.8.2.

Besides the default `--help`, `-f`/`--fields` and `-o`/`--output` options, this command also takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>server</code></p></div></div></td><td><div><div><p>IP address for a DNS server to resolve special domains on. Can be specified up to 3 times</p></div></div></td></tr><tr><td><div><div><p><code>domain</code></p></div></div></td><td><div><div><p>A domain to resolve on the special DNS server list. Can be specified multiple times</p></div></div></td></tr></tbody></table>

You can pass as many domains as you need, and up to 3 IP addresses.  
For example, `$ cloudhub vpc dns-servers set --domain example.com --server 192.168.1.10 <VPC Name>`.

Every time you run this command, you overwrite your previous DNS set command.  
To remove a DNS set, you need to use the [vpc dns-servers unset](#cloudhub-vpc-dns-servers-unset)
command.

## cloudhub vpc dns-servers unset

\> cloudhub vpc dns-servers unset \[options\] <vpc>

This command clears the list of local host names (internal domain names) to be resolved using your
DNS servers from the Anypoint VPC passed in `<vpc>`.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc firewall-rules describe

\> cloudhub vpc firewall-rules describe <vpc>

This command describes all the firewall rules for the Anypoint VPC defined in `<vpc>`.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc firewall-rules add

\> cloudhub vpc firewall-rules add \[options\] <vpc> <cidrBlock> <protocol> <fromPort> \[toPort\]

This command adds a firewall rule to the Anypoint VPC defined in `<vpc>` using the values set in the
variables:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><div><div><p><code>vpc</code></p></div></div></td><td><div><div><p>Name of the Anypoint VPC to which this load balancer is bound.<br>If your Anypoint VPC name contains spaces, you need to pass it between ´"´ characters</p></div></div></td><td><div><div><p>vpc-demo</p></div></div></td></tr><tr><td><div><div><p><code>cidrBlock</code></p></div></div></td><td><div><div><p>IP address in CIDR notation for the firewall to allow</p></div></div></td><td><div><div><p>192.0.1.0/27</p></div></div></td></tr><tr><td><div><div><p><code>protocol</code></p></div></div></td><td><div><div><p>The protocol to use in the rules. It can be <code>tcp</code> or <code>udp</code></p></div></div></td><td><div><div><p>tcp</p></div></div></td></tr><tr><td><div><div><p><code>fromPort</code></p></div></div></td><td><div><div><p>The port from which the firewall will allow requests. It can go from 0 to 65535</p></div></div></td><td><div><div><p>8888</p></div></div></td></tr><tr><td><div><div><p><code>toPort</code></p></div></div></td><td><div><div><p><strong>optional</strong> In case a port range is needed, the <code>fromPort</code> and <code>toPort</code> variables define such range</p></div></div></td><td><div><div><p>8090</p></div></div></td></tr></tbody></table>

> [!CAUTION] When creating an Anypoint VPC, make sure to allow your outbound address.  
> By default, all IP addresses are blocked, and you need to authorize IP addresses or range of
> addresses to your Anypoint VPC firewall rule.

You can start typing your Anypoint VPC’s name and press `tab` for Anypoint Platform CLI to
autocomplete it, or you can double tap `tab` for a full list of all the values you can pass.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

## cloudhub vpc firewall-rules remove

\> cloudhub vpc firewall-rules remove <vpc> <index>

This command removes the firewall rule from the workers inside the Anypoint VPC specified in `<vpc>`
at the index passed in the `<index>`.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.
