Export an existing resource to Terraform
export_terraformGenerate Terraform (HCL) for EXISTING Control Plane resources from a self link. Single resource (/org/acme/gvc/prod/workload/api) or bulk by path depth — /org/acme exports the whole org, /org/acme/gvc/prod/workload exports every workload in a GVC. Set generateImports to get ready-to-run terraform import commands for adopting the resources into Terraform state, and includeDependencies to pull in referenced resources. Secrets are never exported; a ref or dependency closure that includes them is refused. An unsupported kind is rejected with the supported list. For an in-memory manifest, use convert_to_terraform.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource | Yes | Self link of an existing resource, e.g. `/org/acme/gvc/prod/workload/api` (a full `https://api.cpln.io/org/...` URL is also accepted). Use a shorter path for a bulk export: `/org/acme` (whole org) or `/org/acme/gvc/prod/workload` (all workloads in a GVC). | |
| generateImports | No | Also return the matching `terraform import` commands, one per resource with the import IDs prefilled. Run them after `terraform init` and before the first `terraform apply` so the existing resources are adopted into state instead of re-created. | |
| includeDependencies | No | Also export referenced/dependent resources so the generated HCL is self-contained. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | The full result. Read this, not only the summary. | |
| details | No | ||
| summary | Yes | ||
| nextSteps | No |