Skip to main content

Multi-Region Support

Starting from CLI version 1.2.0, CloudBase CLI supports multi-region resource operations, allowing you to easily manage CloudBase environments and resources across different regions through the command line.

Quick Start

Default Region

By default, the CLI operates on environments in the Shanghai region (ap-shanghai). If your environment is in Shanghai, no additional configuration is required.

Specifying a Region

When you need to operate on environments in other regions, use the -r global parameter to specify the region:

# View environment list in Guangzhou region
tcb env list -r gz

# Deploy function to Guangzhou region
tcb fn deploy myFunction -r gz -e your-env-id

Tip

The -r parameter is a global parameter and applies to all CLI commands

Supported Regions

The following table lists the currently supported regions and their abbreviations:

RegionAbbreviationFull IdentifierDescription
Guangzhougzap-guangzhouSouth China
Beijingbjap-beijingNorth China
Shanghaishap-shanghaiEast China (default)
Note
  • When using the CLI, you can use either the abbreviation (e.g., gz) or the full identifier (e.g., ap-guangzhou)

Configuration File Method

Specifying Region in Configuration File

You can specify the environment region in the cloudbaserc.json configuration file, eliminating the need to add the -r parameter each time:

{
"version": "2.0",
"envId": "your-env-id",
"region": "ap-guangzhou",
"functionRoot": "./functions",
"functions": [
{
"name": "app",
"timeout": 5,
"runtime": "Nodejs16.13"
}
]
}