Terraform import for full org DR snapshot fails on dependency resolution

Trying to export the whole org config for DR using the Terraform provider. Running terraform import on a massive batch of resources hits a wall. The graph builder chokes on circular deps between queues and routing profiles. Any script to flatten this or should I just dump the JSON from the API and parse it manually? The import command is timing out after 10 mins with no clear error log.

Skip the import. It’s a nightmare for DR. Just hit the API directly. Here’s a quick curl to dump the org config. You’ll get clean JSON without the dependency hell.

curl -X GET "https://api.mypurecloud.com/api/v2/organizations" \
 -H "Authorization: Bearer $TOKEN"

Parse that locally. Much faster.

Dumping JSON manually is messy. You’ll still need to resolve the IDs. The Terraform provider has a built-in exporter that handles the graph resolution for you. It’s way more reliable than trying to parse raw API responses in C#.

Run this in your project directory:

genesys-cloud-terraform-provider export --output-dir ./dr-snapshot --recursive

It generates the HCL files with the dependencies already sorted. If you hit the timeout, increase the TF_LOG level to DEBUG to see where it’s hanging. Usually it’s a large queue with thousands of members. You can split the export by resource type using --resource-types queue,routing_profile to keep it under the 10-minute limit.

The docs state: “The export command generates Terraform configuration for existing resources.” It doesn’t mention the timeout limits though. Just be careful with sensitive data like IVR prompts if you’re storing this in a public repo.

I’ve used this for our BDR setup. Works fine.