## Recovering from partial state

If resources were created outside Terraform (or state was lost), import them
before `terraform apply`:

```bash
# sim-env (namespace: swarm)
terraform import kubernetes_namespace.swarm swarm
terraform import kubernetes_stateful_set.drone swarm/drone
terraform import kubernetes_deployment.exporter swarm/exporter
terraform import kubernetes_deployment.explorer swarm/explorer
terraform import kubernetes_deployment.prometheus swarm/prometheus
terraform import kubernetes_deployment.grafana swarm/grafana
terraform import kubernetes_service.exporter swarm/exporter
terraform import kubernetes_service.explorer swarm/explorer
terraform import kubernetes_service.prometheus swarm/prometheus
terraform import kubernetes_service.grafana swarm/grafana
terraform import kubernetes_config_map.prometheus swarm/prometheus-config
terraform import kubernetes_config_map.grafana_provisioning swarm/grafana-provisioning
terraform import kubernetes_config_map.grafana_dashboard swarm/grafana-dashboard

# ground (namespace: ground)
terraform import kubernetes_namespace.ground ground
terraform import kubernetes_persistent_volume_claim.minio ground/minio-data
terraform import kubernetes_secret.minio ground/minio-credentials
terraform import kubernetes_deployment.minio ground/minio
terraform import kubernetes_deployment.warehouse_explorer ground/warehouse-explorer
terraform import kubernetes_service.minio ground/minio
terraform import kubernetes_service.warehouse_explorer ground/warehouse-explorer
terraform import kubernetes_cron_job_v1.offload ground/offload
```

Then `terraform apply` reconciles drift (for example pinning `EXPLORER_PORT`
and `EXPORTER_PORT` so Kubernetes service env injection does not break startup).
