Skip to main content

tcb config update

Push the configuration in cloudbaserc.json to the cloud, syncing local and cloud resource configuration.

Usage​

tcb config update <module> [name] [options]

<module> is the resource module:

ModuleDescription
fnPush function configuration
integrationPush integration configuration

Parameters​

ParameterRequiredDescriptionDefault
[name]NoResource name, mutually exclusive with --all—
--allNoPush every resource declared in the configuration filefalse
-e, --env-id <envId>NoEnvironment ID—
--timeout <timeout>NoFunction timeout in seconds—
--memory <memory>NoFunction memory in MB—
--runtime <runtime>NoFunction runtime—
--handler <handler>NoFunction handler—
--vpc <vpcId/subnetId>NoFunction VPC, formatted vpcId/subnetId—
--env <key=value>NoFunction environment variable, repeatable—
--env-mode <mode>NoEnvironment variable update mode: merge / overwritePrompts
--yesNoSkip confirmationfalse

Examples​

# Push a single function
tcb config update fn hello

# Push every function declared in the configuration file
tcb config update fn --all

# Push a single integration
tcb config update integration myPayment

# Push every integration without confirmation
tcb config update integration --all --yes

Change a single field straight from the command line instead of editing the file first:

# Timeout
tcb config update fn myFunc --timeout 60 -e envId --yes

# Memory
tcb config update fn myFunc --memory 512 -e envId --yes

# Merge environment variables, keeping the existing ones
tcb config update fn myFunc --env DB_HOST=127.0.0.1 --env-mode merge -e envId --yes

# Overwrite environment variables, replacing every value in the cloud
tcb config update fn myFunc --env DB_HOST=127.0.0.1 --env-mode overwrite -e envId --yes

# Several fields at once
tcb config update fn myFunc --timeout 30 --memory 256 --env NODE_ENV=production -e envId --yes

Behaviour​

Function configuration:

  1. Reads the functions field of cloudbaserc.json
  2. Precedence: CLI parameters override the configuration file
  3. When environment variables are present, the CLI asks for the update mode: overwrite replaces the cloud set, merge keeps cloud values and lets local ones win on name collisions
  4. --all pushes every function in the configuration file

Integration configuration:

  1. Reads the integrations field
  2. Matches the cloud instance by keyId
  3. An optional field explicitly set to an empty string '' clears the cloud field; a required field left out keeps the cloud value
  4. --all pushes every integration

Merge rules for integration fields: see Update an integration.