Looking for the cleanest way to dump the entire org config into Terraform state for a DR runbook. The genesyscloud provider docs are light on bulk export patterns. I’ve been chaining terraform import for every resource, but it’s painful and error-prone for large orgs.
Is there a supported script or API call to generate the initial HCL from an existing org? I tried writing a quick Node script to hit /api/v2/organization and loop through resources, but the dependency graph is a nightmare to serialize manually.
Here’s the basic loop I’m using right now to fetch resource IDs, which feels wrong:
const resources = await client.resourcesApi.getOrganizationResources();
for (const res of resources.resources) {
console.log(`terraform import ${res.type}.${res.id} ${res.id}`);
}
This doesn’t capture attributes or relationships. Just generates a list of IDs to import. Anyone have a working example of a full config export script or a provider feature I’m missing?