Skip to main content

Configuration Architecture

The sync system uses a three-tier architecture to separate concerns: This separation lets you mix and match environments, targets, and triggers independently — for example, deploying the same target to different environments based on which branch or tag is active.

Environments (WHERE)

Environments define deployment target locations with authentication:
API keys are never stored in configuration files. They’re referenced via environment variables for security. Alternatively, use profile to authenticate with a named kdx CLI profile — this is convenient for local development where you already have profiles configured.

Targets (WHAT)

Targets bundle an organization with its manifests:
Targets let you group resources logically. A single target can reference multiple manifest files, and the same manifest can appear in multiple targets — making it easy to share common resources across divisions or teams.

Branch Mappings (WHEN)

Branch mappings automate deployment based on git branches:
Each mapping has a pattern that matches against the current git branch. When a match is found, the specified targets are deployed to their associated environments.

Tag Mappings (WHEN)

NEW in v0.5.0: Deploy using git tags in addition to branches with tag_mappings.
Tag mappings work the same way as branch mappings but trigger on git tags instead of branches. This is especially useful for release workflows:
You can use both branch_mappings and tag_mappings in the same configuration. When using --tag or --branch flags, automatic git detection is overridden with your specified value.

Complete Example

A full sync-config.yaml combining all three tiers:

Configuration Reference