Import Existing Resources
Every resource type supports terraform import, so a cluster, secret, tenant member, or API key created through the console doesn’t need to be recreated to come under Terraform management:
terraform import kupe_cluster.production productionterraform import kupe_secret.db_password db-passwordterraform import kupe_tenant_member.lead lead@example.comterraform import kupe_api_key.cicd ak-abc123Migrating from the console
Section titled “Migrating from the console”- Add a
resourceblock for each object you already have. The block must exist before you import into it. - Run
terraform importfor each resource. - Run
terraform planand adjust the configuration until it matches the imported state cleanly. - Commit the configuration and make later changes through Terraform.
Importing API keys
Section titled “Importing API keys”Importing a kupe_api_key works, but the key attribute comes back empty; the raw key value cannot be recovered from the platform after creation.
If you need the raw key for CI or another secret store, revoke the imported key and create a new one with Terraform instead.