Terraform genesyscloud provider: How to export full org config for DR without state file bloat?

We are building a disaster recovery plan for our Genesys Cloud environment. The goal is to have a script that can pull the entire organization configuration into Terraform state files so we can redeploy it on another org if needed.

I am using the genesyscloud provider. I tried using terraform import for resources, but that requires knowing every single resource ID beforehand. There are thousands of users and routing queues. It is not practical to list them all.

I found the genesyscloud_resource_export data source. It seems promising. I wrote this code to try and export everything:

data "genesyscloud_resource_export" "full_export" {
 export_config {
 resource_types = [
 "routing_queue",
 "user",
 "flow",
 "integration"
 ]
 ignore_errors = true
 }
}

The problem is the output. The genesyscloud_resource_export data source generates a .zip file of JSON files. It does not generate Terraform HCL code. I cannot just terraform apply the JSON. I have to parse the JSON and convert it to HCL manually or write a script to do it. That sounds like a lot of work and error-prone.

Is there a way to use the SDK or Terraform to generate the actual HCL files directly? Or is there a better way to handle full org exports for DR using code? The documentation is not clear on this part. I just need a reliable way to snapshot the config.

Pulling the whole org into Terraform state is a recipe for disaster. You’ll hit API rate limits, state file corruption, and deployment timeouts before you even get started. The vider just isn’t built for that scale of bulk import.

Instead, use the Genesys Cloud Configuration Export API. It spits out a single JSON package of your entire org config. You don’t need to manage thousands of individual resource IDs. Just grab the export, store it in S3 or Azure Blob, and use the import API in your DR script to restore it.

Here’s the curl command to kick it off:

curl -X POST "https://api.mypurecloud.com/api/v2/orgconfig/export" \
 -H "Authorization: Bearer <your_token>" \
 -H "Content-Type: application/json"

It returns a job ID. Poll that ID until the status is completed. Then download the artifact. It’s messy, but it works. Terraform is for defining state, not capturing a snapshot of a live, changing environment.