Skip to content

cub unit apply

cub unit apply

Apply configuration units to the target

Synopsis

Apply configuration units to the target.

A target must be attached to the unit (cub unit set-target can be used to add one), and the worker corresponding to the target must be connected and ready (cub worker get can be used to get the worker status).

Examples:

  # Apply a single unit by slug
  cub unit apply my-unit

  # Apply a specific revision
  cub unit apply my-unit --revision 5
  cub unit apply my-unit --revision LiveRevisionNum
  cub unit apply my-unit --revision Tag:release-v1.0

  # Apply multiple specific units
  cub unit apply --space my-space --unit unit1,unit2,unit3
  cub unit apply --space my-space --unit unit1 --unit unit2 --unit unit3

  # Bulk apply units using a WHERE clause with labels
  cub unit apply --space my-space --where "Labels.Tier = 'backend'"

  # Apply specific revision for multiple units
  cub unit apply --space my-space --where "Labels.Tier = 'backend'" --revision LiveRevisionNum

  # Apply units with multiple label conditions
  cub unit apply --space my-space --where "Labels.App = 'api' AND Labels.Tier = 'backend'"

  # Dry run to see what would be applied
  cub unit apply --space my-space --unit unit1,unit2 --dry-run

  # Apply all unapplied units in a space
  cub unit apply --space my-space --where "HeadRevisionNum > LiveRevisionNum"

  # Apply units across all spaces (requires --space "*")
  cub unit apply --space "*" --where "Space.Labels.Environment = 'staging'"
cub unit apply [<unit-slug>] [flags]

Options

      --drift-mode string   Drift reconciliation mode (OnDemand, ContinuousApply, ContinuousRefresh)
      --dry-run             Perform a dry run without actually applying
      --filter string       Filter entity to apply to the list. Specify as 'space/filter' for cross-space filters or just 'filter' for current space. Supports both slugs and UUIDs. The filter will be combined with any --where clause using AND logic. Examples: "production-filters/security-check", "my-filter-uuid", "validation-rules"
  -h, --help                help for apply
      --jq string           jq expression, suppressing default output
      --json                JSON output, suppressing default output
      --quiet               No default output.
      --revision string     Revision to apply (defaults to HeadRevisionNum). Can be a revision number, 'LiveRevisionNum', 'LastAppliedRevisionNum', 'Tag:slug', 'ChangeSet:slug', etc.
      --timeout string      completion timeout as a duration with units, such as 10s or 2m (default "10m0s")
      --unit strings        target specific units by slug or UUID (can be repeated or comma-separated)
      --verbose             Detailed output, additive with default output
      --wait                wait for completion
      --where string        Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
      --yaml                YAML output, suppressing default output
      --yq string           yq expression, suppressing default output

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output
      --space string     space ID to perform command on

SEE ALSO