tcb fn copy
Copies a function to another name within the same environment.
Usage
tcb fn copy <sourceName> <targetName> [options]
Flags
| Flag | Required | Description | Default |
|---|---|---|---|
<sourceName> | Yes | Source function name | — |
<targetName> | Yes | Target function name | — |
--force | No | Overwrite the target when it already exists | — |
Example
# Copy the app function to app2
tcb fn copy app app2
# Overwrite an existing target
tcb fn copy app app2 --force
Notes
- The copy carries code, timeout, memory, environment variables, VPC configuration, handler, and runtime
- Triggers are not copied, configure them separately for the target function
Related commands
- Delete a function
- Deploy a function: adjust the configuration of the copy