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.