Skip to main content

tcb env create

Creates a CloudBase environment. Without parameters it runs interactively.

Usage​

tcb env create [options]

Flags​

FlagRequiredDescriptionDefault
--alias <alias>NoEnvironment alias—
--package <package>NoPackage ID. Lists the available packages when omitted—
--region <region>NoEnvironment regionap-shanghai
--duration <duration>NoPurchase duration in months, 1 to 12 or 241
--auto-renewNoEnable auto renewalNo
--external-storage-bucket <bucket>NoName of the shared COS bucket for cloud storage—
--external-storage-region <region>NoRegion of the shared bucket, such as ap-shanghai—
--external-storage-base-path <basePath>NoDirectory prefix of this environment inside the shared bucket—
--yesNoNon-interactive mode, skips confirmation promptsNo
--platform-id <platformId>NoPlatform 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 IDNameIntended for
baas_personalPersonalGetting started, cost effective
baas_pf_standardStandardSmall teams
baas_pf_enterpriseEnterpriseSmall 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.