Skip to main content

Multiple Regions

Starting from CLI version 1.2.0, support for multiple regions has been added, enabling you to operate cloud development resources in different regions via CLI.

By default, the CLI can directly operate environments in the Shanghai region. When you need to operate environments in other regions, specify the region via the -r global parameter, for example

# List Environments in Guangzhou Region
tcb env list -r gz

# Deploy Function to Environment in Guangzhou Region
tcb fn deploy app -r gz -e envID

...

When the -r parameter is not specified, the environment is considered to be in the Shanghai region.

tip

The -r` parameter applies to all commands.

Region List

gzis the abbreviation for the Guangzhou region, with the full nameap-guangzhou`. When using the CLI, abbreviations can be utilized. Below is the shorthand information for all regions.

# Supported Regions
gz: ap-guangzhou
bj: ap-beijing
sh: ap-shanghai

# Potentially Supported Regions
# nj: ap-nanjing
# cd: ap-chengdu
# cq: ap-chongqing

Configuration File

You can also specify the region information for the environment in the configuration file without adding the -r parameter, as shown below

{
"version": "2.0",
"envId": "envId",
"region": "ap-guangzhou",
"framework": {
"name": "koa-starter",
"plugins": {
"node": {
"use": "@cloudbase/framework-plugin-node",
"inputs": {
"name": "koa-starter",
"path": "/koa-starter"
}
}
}
}
}