Skip to main content
Resource providers automatically discover and sync your infrastructure into Ctrlplane’s resource inventory. This enables dynamic environment targeting based on resource metadata.

Quick Start

All providers use the same pattern:
# Set up authentication
export CTRLPLANE_API_KEY="your-api-key"

# Sync resources (one-time)
ctrlc sync <provider> [options]

# Sync on interval (continuous)
ctrlc sync <provider> --interval 5m [options]

Common Patterns

Continuous Sync

Run sync on an interval to keep resources up-to-date:
# Sync every 5 minutes
ctrlc sync kubernetes --interval 5m --cluster-name prod-cluster

# Sync every hour
ctrlc sync aws eks --region us-east-1 --interval 1h

Running in Kubernetes

Deploy a sync job as a Kubernetes CronJob or Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ctrlplane-sync
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ctrlplane-sync
  template:
    metadata:
      labels:
        app: ctrlplane-sync
    spec:
      containers:
        - name: sync
          image: ctrlplane/cli:latest
          command:
            - ctrlc
            - sync
            - kubernetes
            - --interval
            - "5m"
            - --cluster-name
            - "$(CLUSTER_NAME)"
          env:
            - name: CTRLPLANE_API_KEY
              valueFrom:
                secretKeyRef:
                  name: ctrlplane-credentials
                  key: api-key
            - name: CLUSTER_NAME
              value: "my-cluster"

Resource Schema

All resources follow the same schema:
FieldRequiredDescription
identifierYesUnique identifier (auto-generated by providers)
nameYesHuman-readable name
kindYesResource type (e.g., Kubernetes/Namespace)
versionYesResource version
metadataNoKey-value pairs for filtering and selectors
configNoConfiguration passed to job agents

Metadata vs Config

  • Metadata — Used for environment selectors and filtering
  • Config — Passed to job agents for deployment execution
# Metadata: used for targeting
metadata:
  environment: production
  region: us-east-1
  team: platform

# Config: used by job agents
config:
  namespace: my-app
  cluster_url: https://k8s.example.com

Environment Selectors

Resources are matched to environments using selectors:
type: Environment
name: Production US
resourceSelector: |
  resource.metadata["environment"] == "production" &&
  resource.metadata["region"].startsWith("us-")
When resources are synced, environments automatically re-evaluate selectors.

Next Steps