Archiving environments requires the Admin role.
This page covers managing environments via Terraform. For creating environments via the CLI or UI, see Getting started: Environments.
- — each maps to a single runtime (e.g. a Kubernetes cluster or ECS service). Managed with the
kosli_environmentresource. - — aggregate one or more physical environments into a single view. Managed with the
kosli_logical_environmentresource.
Managing physical environments
Create a physical environment
K8S, ECS, S3, docker, server, lambda.
Import an existing physical environment
If you have environments created via the UI or CLI, you can bring them under Terraform management by importing them into your .- Find the environment name in the Kosli UI under Environments, or run:
- Add a matching
kosli_environmentresource block to your configuration:
- Run the import:
- Verify with
terraform plan— no changes should be planned if the import succeeded.
Managing logical environments
Logical environments group physical environments into a combined view — useful for representing a full production tier across multiple runtimes.Create a logical environment
included_environments must reference the names of existing physical environments. Logical environments cannot include other logical environments.
Import an existing logical environment
- Find the logical environment name:
- Add a matching
kosli_logical_environmentresource block:
- Run the import:
- Verify with
terraform plan— no changes should be planned if the import succeeded.