# Config as code

For: Developers, CI pipelines

Describe an environment in dispra.yaml, review the plan, and apply it.

## The problem

Settings changed by hand drift between environments and nobody knows why.

## How it works

1. Write the environment's services, variables and volumes in dispra.yaml, or export it. ([Export the environment](https://docs.dispralabs.com/api/export-the-environment.md))
2. Plan the file to see every change. ([Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md))
3. Apply exactly that plan. ([config.apply](https://docs.dispralabs.com/flows/config-apply.md))

## Limits

- Secret values never go in the file: declare them as ${{ secret }}
- Apply never deletes volumes

## Flows

- [config.apply](https://docs.dispralabs.com/flows/config-apply.md)

## API

- `GET` [Export the environment](https://docs.dispralabs.com/api/export-the-environment.md)
- `POST` [Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md)
