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​

The default region follows the site:

SiteDefault Region
Domestic siteap-shanghai (Shanghai)
International siteap-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

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 (domestic site default)
Singaporeap-singaporeSoutheast Asia (international site default)
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"
}
]
}