cpln delete command removes resources defined in YAML or JSON files, the inverse of cpln apply. Use the same manifest files to both create and tear down infrastructure.
When to use this
Tear down environments
Remove entire environments using the same manifests that created them
GitOps cleanup
Delete resources tracked in version control
Remove K8s conversions
Delete resources originally created from Kubernetes manifests
Batch deletion
Remove multiple related resources in one command
Basic usage
Options
| Option | Description |
|---|---|
--file | Path to JSON/YAML file. Use --file - for stdin |
--gvc | GVC for scoped resources (workloads, identities, volumesets) |
--k8s | Convert K8s manifest before deleting (true/false) |
Specify the GVC
Workloads, identities, and volumesets are scoped to a GVC. Specify it using one of these methods:- --gvc flag
- In the manifest
- Profile default
Pass the GVC with each command:
You can either specify the GVC in the manifest or via
--gvc, but not both.Delete Kubernetes conversions
Delete resources that were originally applied from Kubernetes manifests:Delete from stdin
Pipe resources from another command:Multiple resources
Delete multiple resources from a single file using YAML document separators (---):
resources.yaml
Using the console
Delete resources via the console:- Click cpln apply in the upper right corner
- Enable the Use as Delete switch
- Upload or paste your manifest
- Select the target org and GVC
- Click Delete
Common workflows
Tear down a complete environment
Remove a feature branch environment
Troubleshooting
Resource not found
Resource not found
The resource may have already been deleted or never existed. This is not an error - the command is idempotent.
GVC required
GVC required
For workloads, identities, and volumesets, specify the GVC:
Dependency errors
Dependency errors
Some resources can’t be deleted if other resources depend on them. Delete dependent resources first, or delete the GVC containing all resources.