tcb env create
Creates a CloudBase environment. Without parameters it runs interactively.
Usage
tcb env create [options]
Flags
| Flag | Required | Description | Default |
|---|---|---|---|
--alias <alias> | No | Environment alias | — |
--package <package> | No | Package ID. Lists the available packages when omitted | — |
--region <region> | No | Environment region | ap-shanghai |
--duration <duration> | No | Purchase duration in months, 1 to 12 or 24 | 1 |
--auto-renew | No | Enable auto renewal | No |
--external-storage-bucket <bucket> | No | Name of the shared COS bucket for cloud storage | — |
--external-storage-region <region> | No | Region of the shared bucket, such as ap-shanghai | — |
--external-storage-base-path <basePath> | No | Directory prefix of this environment inside the shared bucket | — |
--yes | No | Non-interactive mode, skips confirmation prompts | No |
--platform-id <platformId> | No | Platform edition resource pool ID, creates the environment in that pool | — |
Example
# Interactive creation, lists the available packages
tcb env create
# Specify alias, package, region, and duration
tcb env create --alias demo --package baas_personal --region ap-shanghai --duration 1
# Create in a platform edition resource pool (v3.8.3+, no package needed)
tcb env create --platform-id <platformId> --alias demo --yes
Versions
tcb env create has been available since v3.0.0, --platform-id since v3.8.3.
Packages
| Package ID | Name | Intended for |
|---|---|---|
baas_personal | Personal | Getting started, cost effective |
baas_pf_standard | Standard | Small teams |
baas_pf_enterprise | Enterprise | Small and medium businesses |
See the CloudBase pricing page for prices and quotas.
Shared COS bucket
A single account has a quota on COS buckets. When you need many environments, several environments can share one COS bucket with each environment using its own directory prefix:
tcb env create --alias tenant-a --package baas_personal --yes \
--external-storage-bucket my-bucket-1250000000 \
--external-storage-region ap-shanghai \
--external-storage-base-path tenant-a
- All three
--external-storage-*parameters must be provided together, a partial set fails the parameter check and no environment is created - Base paths must be unique inside the same shared bucket
- This only covers cloud storage, not static hosting. The static hosting bucket is allocated by the platform and has no CLI parameter, see Appendix: shared COS bucket
Platform edition
With --platform-id the environment is created in a platform edition resource pool, and --package, --region, --duration, --auto-renew are mutually exclusive with it. Platform edition is an account-level package, see Platform edition overview.