Update Integration Configuration
Use the tcb config update integration command to push integration configurations from cloudbaserc.json to the cloud.
tcb config update integration [keyId] [options]
Command Parameters
| Parameter | Description | Required |
|---|---|---|
[keyId] | Integration Key ID | No (choose one with --all) |
--all | Push configurations of all integrations in the configuration file | No |
-e, --env-id <envId> | Environment ID | No |
--yes | Skip interactive confirmation (use merge mode by default) | No |
Usage Examples
Push Single Integration Configuration
# Push configuration for a single integration
tcb config update integration key-721a6e232e169382d3cbc5faa3dc2cd6
# Automatic confirmation, skip interactive prompts
tcb config update integration key-721a6e232e169382d3cbc5faa3dc2cd6 --yes
Batch Push All Integration Configurations
# Push configurations of all integrations in the configuration file
tcb config update integration --all
# Automatic confirmation, skip interactive prompts
tcb config update integration --all --yes
Push Behavior
- Read Local Configuration: Read integration configurations from the
integrationsfield incloudbaserc.json. - Match Cloud Instance: Match the existing integration instance in the cloud based on the
keyIdfield in the configuration. - Smart Merge (default mode):
- Local and cloud configurations are merged, local overrides same-name fields
- Fields not configured locally retain cloud values
- Fields explicitly set to empty string
''locally will clear the corresponding fields in the cloud - Fields with value
******(MASK placeholder) locally will skip update and retain cloud original values
- Overwrite Update (
--yesmode):- Replace cloud configuration completely with local configuration
- Fields not configured locally will be deleted
Configuration File Format
Integration configurations are defined via the integrations field in cloudbaserc.json:
{
"integrations": [
{
"keyId": "key-721a6e232e169382d3cbc5faa3dc2cd6",
"name": "myPayment",
"authTypeCode": "weixinpaydc",
"description": "WeChat Pay Integration",
"envVariables": {
"mch_id": "your-mch-id",
"api_key": "your-api-key"
},
"demoCodeFunctionName": "demo-payment"
}
]
}
Notes:
keyIdfield is required to match the cloud integration instance- Sensitive fields (e.g.,
api_key) will be displayed as******placeholder aftertcb config init integration, and will retain cloud original values when pushed- Callback URLs (e.g.,
notify_url) are automatically generated by the system, no need to configure manually
Read Field Values from a File (@ File Reference Syntax)
For multi-line text or long sensitive content (such as WeChat Pay's privateKey, apiV3Key), you can use the @ prefix in envVariables values to reference a file directly. The file content is automatically read as the field value when pushing:
{
"envVariables": {
"apiV3Key": "@./secrets/apiv3key.txt",
"privateKey": "@./secrets/apiclient_key.pem"
}
}
@./certs/key.pem: relative path (relative to the directory wherecloudbaserc.jsonis located)@/absolute/path/key.pem: absolute path- A plain string not starting with
@is treated as a literal value
See Create Integration - Read Field Values from a File for details.
Environment Variable Update Mode
When updating integration configurations, two environment variable update modes are supported:
1. Merge Update (Default)
- Local and cloud environment variables are merged
- Local overrides same-name variables
- Variables not configured locally retain cloud values
- Recommended for production environments to avoid accidentally deleting cloud configurations
2. Overwrite Update
- Replace cloud environment variables completely with local environment variables
- Variables not configured locally will be deleted
- This mode is used when
--yesparameter is specified
Notes
- Authentication type (
authTypeCode) cannot be modified after creation. - The
keyIdfield must be included in the configuration file, otherwise an error will be reported. - When sensitive fields are displayed as
******placeholder in the configuration file, the cloud original values will be retained when pushed. - If the local configuration is explicitly set to an empty string (e.g.,
demoCodeFunctionName: ""), the corresponding field in the cloud will be cleared.