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:
| Module | Description |
|---|---|
fn | Push function configuration |
integration | Push integration configuration |
Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
[name] | No | Resource name, mutually exclusive with --all | — |
--all | No | Push every resource declared in the configuration file | false |
-e, --env-id <envId> | No | Environment ID | — |
--timeout <timeout> | No | Function timeout in seconds | — |
--memory <memory> | No | Function memory in MB | — |
--runtime <runtime> | No | Function runtime | — |
--handler <handler> | No | Function handler | — |
--vpc <vpcId/subnetId> | No | Function VPC, formatted vpcId/subnetId | — |
--env <key=value> | No | Function environment variable, repeatable | — |
--env-mode <mode> | No | Environment variable update mode: merge / overwrite | Prompts |
--yes | No | Skip confirmation | false |
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:
- Reads the
functionsfield ofcloudbaserc.json - Precedence: CLI parameters override the configuration file
- 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
--allpushes every function in the configuration file
Integration configuration:
- Reads the
integrationsfield - Matches the cloud instance by
keyId - An optional field explicitly set to an empty string
''clears the cloud field; a required field left out keeps the cloud value --allpushes every integration
Merge rules for integration fields: see Update an integration.
Related Commands
- Pull configuration: sync from the cloud to the local file
- Compare configuration: review differences before pushing
- Configuration file:
functionsandintegrationsfield definitions