Skip to main content

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

ParameterDescriptionRequired
[keyId]Integration Key IDNo (choose one with --all)
--allPush configurations of all integrations in the configuration fileNo
-e, --env-id <envId>Environment IDNo
--yesSkip 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

  1. Read Local Configuration: Read integration configurations from the integrations field in cloudbaserc.json.
  2. Match Cloud Instance: Match the existing integration instance in the cloud based on the keyId field in the configuration.
  3. 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
  4. Overwrite Update (--yes mode):
    • 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"
}
]
}

Configuration Field Description

For field types, required status, and descriptions, see Configuration File - Integration.

Notes:

  • Sensitive fields (e.g., api_key) will be displayed as ****** placeholder after tcb 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

Multi-line sensitive fields (such as privateKey, apiV3Key) support the @ file reference syntax; see Configuration File - 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 --yes parameter is specified

Notes

  • Authentication type (authTypeCode) cannot be modified after creation.
  • The keyId field 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.