Export to Terraform
export_terraformGenerate Terraform (HCL) for EXISTING Control Plane resources from a self link (resource): one resource (/org/acme/gvc/prod/workload/api) or bulk by path depth (/org/acme exports the whole org, /org/acme/gvc/prod/workload every workload in a GVC). Or convert a manifest (YAML or JSON) with its org, and gvc for a GVC-scoped kind: it is dry-run validated against the API first (nothing is created), and a validation failure returns the error instead of HCL. 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 or converted: a ref, manifest, or dependency closure that includes one is refused. An unsupported kind is rejected with the supported list.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_terraform"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gvc | No | The `manifest`'s GVC when its kind is GVC-scoped (workload, identity, volumeset). With `resource`, it must match the self link. | |
| org | No | The `manifest`'s org. With `resource`, it must match the self link, and is required when several orgs are granted. | |
| manifest | No | Instead of `resource`: one resource manifest to convert, YAML or JSON, with `kind` and `name`. | |
| resource | No | 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 | With `resource`: 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 |