Skip to main content
The cpln apply command creates or updates Control Plane resources from JSON or YAML files, enabling infrastructure-as-code workflows.

When to use this

GitOps workflows

Store resource definitions in Git and apply them in CI/CD pipelines

Reproducible deployments

Apply the same configuration across multiple environments

Bulk operations

Create or update multiple resources in a single command

Scripting & automation

Automate resource management in scripts and pipelines
The cpln apply command is idempotent - running it multiple times with the same input produces the same result.

Basic usage

The file can be JSON or YAML containing one or more resource definitions.

Specifying the GVC

For resources that belong to a GVC (Identity, Volume Set, Workload), specify the GVC using one of these methods:
Set a default GVC in your profile:
All subsequent commands will use this GVC.
You can specify either a gvc property in the file or use the --gvc flag, but not both.

Apply Kubernetes manifests

Convert and apply Kubernetes resources directly:
This uses the convert logic to transform K8s resources before applying.

Apply from stdin

Pipe resource definitions from another command:
This is useful for dynamically generating resources or chaining commands.

Using the console

The console also supports applying resources:
  1. Click the cpln apply button in the upper right corner
  2. Upload a JSON/YAML file or paste the resource definition
  3. Select the target org and GVC
  4. Click Apply

Multiple resources

Apply multiple resources in a single file by separating them with ---:
If a resource references another resource (e.g., a workload references a GVC), the referenced resource must be defined in the same file unless it already exists.

Resource ordering

The cpln apply command handles resource ordering automatically — you do not need to worry about the order of resources in your files or directories. The CLI resolves dependencies internally.

Renaming resources

Changing a resource’s name in the file creates a new resource. The original resource remains and must be deleted manually:

Limitations

To create an agent, use the console or CLI agent command to obtain the bootstrap config data. The cpln apply command does not output config data.
Before creating a cloud account, additional configuration is required at the cloud provider. See the Create Cloud Account guide.
Before creating a domain, the required DNS entries must exist. See the Configure a Domain guide.

Generate sample input

Export existing resources as templates:
  1. Select a resource and click ActionsExport
  2. Choose JSON Slim or YAML Slim
  3. Download the file
The json-slim and yaml-slim formats output only the values needed for cpln apply, removing IDs, timestamps, and other metadata.

Use in GitOps

The apply command integrates with CI/CD pipelines for GitOps workflows. See the CI/CD Usage guides for details.

Example templates

Use these templates as starting points for your resource definitions.
Download all examples: cpln-apply-examples.zip
GVC Reference Page
Agent Reference Page
Cloud Accounts Reference Page
Domain Reference Page
Secrets Reference Page
The example below uses a self-signed certificate. Do not use for production.
Groups Reference PageSee the Group Query Rules reference page for details on how to create a query.
Policies Reference PageEach targetKind has its own set of permissions. Get them via:
Identity Reference Page
Workload Reference Page

Next steps

CI/CD Usage

Automate deployments in CI/CD pipelines

Convert K8s Manifests

Convert Kubernetes resources to Control Plane

GitOps

Infrastructure as code workflows

Apply Command Reference

Full apply command reference