# Environments A product runs in environments. Each one has its own data, secrets, release pointer and product host: - `production`, which every product has; - the **previews** you create and destroy; - `ci` and `ci-`, which belong to the platform. Each `ci-` is created for one release's verification run and destroyed when that run ends. ## Creating a preview ```sh aircloud environments create staging ``` A preview starts empty. It runs nothing until a release is activated in it: ```sh aircloud release activate --env staging ``` The name follows the environment grammar: lower-case letters, digits and single inner hyphens. `production`, `ci` and `ci-` are refused, naming the name, before anything is sent. The platform also refuses a name whose product host would not fit one DNS label (`host_label_too_long`). A name the product already has is refused as `conflict`. `config/environments/.toml` overrides keys for the environment of that name, and `config/environments/preview.toml` overrides them for every preview. An overlay changes an environment that exists; it never creates one. ## Listing them ```sh aircloud environments list ``` prints each environment's name, kind (`production` or `preview`) and creation time. ## Destroying a preview ```sh aircloud environments destroy staging ``` erases the preview's data, secrets, release pointer and host. It cannot be undone, so the command asks you to type the environment's name first. Pass `--confirm staging` to confirm without a prompt, for example in a script. `production` and the platform's `ci` environments are never destroyed this way. `aircloud functions list` counts the environments whose active release holds each function, so a function that lived only in a destroyed preview reads `removed` or `undeployed` once the preview is gone. --- Rendered from aircloud 0.1.12 at commit d84a0ce6dae53629277f656d96d81549df36807e.