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 Singapore region
tcb env list -r ap-singapore

# Deploy function to Singapore region
tcb fn deploy myFunction -r ap-singapore -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:

RegionRegion IdentifierDescription
Shanghaiap-shanghaiEast China (default)
Singaporeap-singaporeSoutheast Asia
Guangzhouap-guangzhouSouth China (whitelist only)

ap-beijing (Beijing) is not currently available.

Note
  • The -r / --region parameter requires the full region identifier (e.g. ap-singapore); abbreviations are not supported
  • The Guangzhou region requires whitelist approval before use
  • If you are unsure about the current region, run tcb env list — the current region is shown at the end of the output

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-singapore",
"functionRoot": "./functions",
"functions": [
{
"name": "app",
"timeout": 5,
"runtime": "Nodejs16.13"
}
]
}