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
The default region follows the site:
| Site | Default Region |
|---|---|
| Domestic site | ap-shanghai (Shanghai) |
| International site | ap-singapore (Singapore) |
No additional configuration is required when the environment is in the default region. The site comes from the local isIntl configuration. On the international site, switch with tcb config set isIntl true or tcb login --intl true; see Switch Site.
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
The -r parameter is a global parameter and applies to all CLI commands
Supported Regions
The following table lists the currently supported regions:
| Region | Region Identifier | Description |
|---|---|---|
| Shanghai | ap-shanghai | East China (domestic site default) |
| Singapore | ap-singapore | Southeast Asia (international site default) |
| Guangzhou | ap-guangzhou | South China (whitelist only) |
ap-beijing(Beijing) is not currently available.
- The
-r/--regionparameter 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"
}
]
}