Skip to content

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:

Terminal window
terraform import kupe_cluster.production production
terraform import kupe_secret.db_password db-password
terraform import kupe_tenant_member.lead lead@example.com
terraform import kupe_api_key.cicd ak-abc123
  1. Add a resource block for each object you already have. The block must exist before you import into it.
  2. Run terraform import for each resource.
  3. Run terraform plan and adjust the configuration until it matches the imported state cleanly.
  4. Commit the configuration and make later changes through Terraform.

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.