Legacy Dev Forum Posts

 View Only

Sign Up

CX as Code Exporting existing Genesys Cloud configuration

  • 1.  CX as Code Exporting existing Genesys Cloud configuration

    Posted 06-05-2025 19:18

    javier.delolmo | 2022-02-09 18:57:04 UTC | #1

    Hi Genesys Team, Could you help me? How can I export data in hcl format? I have tried to set the variable exportashcl to true, but terraform tells me that variable does not exist.

    my main.tf:

    terraform {
      required_providers {
        genesyscloud = {
          source = "mypurecloud/genesyscloud"
          version = "~> 1.0.0"
        }
      }
    }
    
    resource "genesyscloud_tf_export" "export" {
      directory          = "./promps"
      resource_types     = ["genesyscloud_architect_user_prompt"]
      export_as_hcl = true
    }

    the error:

    ❯ .\terraform.exe plan
    ╷
    │ Error: Unsupported argument
    │
    │   on main.tf line 20, in resource "genesyscloud_tf_export" "export":
    │   20:   export_as_hcl = true
    │
    │ An argument named "export_as_hcl" is not expected here.

    Where should I set this option to true?

    Regards.


    John_Carnell | 2022-02-09 19:20:34 UTC | #2

    Hi Javier,

    Let me try it locally. The exportashcl feature was just being finished up and I need to check to see if I can reproduce the problem. It is an extremely new feature.

    Thanks, John Carnell Manager, Developer Engagement


    John_Carnell | 2022-02-10 12:37:35 UTC | #3

    Hi Javier,

    I just tried the exportashcl functions expected and it appears to be functioning. I would delete your .terraform.lock.hcl file and then do a terraform init to make sure pull down the latest plugin. If you still have problems please respond as I do most of my work on a mac. My suspicion is that the latest version of the plugin needs to be explicitly pulled down.

    Thanks, John Carnell Manager, Developer Engagement


    javier.delolmo | 2022-02-10 12:43:32 UTC | #4

    Hi @John_Carnell, It was just what you said, I must be using a version older than 1.1.0

    Thanks!


    John_Carnell | 2022-02-10 13:28:36 UTC | #5

    Hi Javier,

    Glad it was such an easy fix. These changes just came out out so we are excited to see people play with them.

    Thanks, John


    Yvgeni_Liberman | 2022-02-27 15:37:01 UTC | #6

    Hello @John_Carnell, maybe a very "stupid" question, if it's possible to take this "hcl" file and import it to the other organization?

    Best regards, Yvgeni


    John_Carnell | 2022-02-28 13:40:57 UTC | #7

    Hi Yvgeni,

    It's not a stupid question at all. The short answer is "yes, but". Whenever possible we have externalized all export data as references. However, the devil is always in the details and sometimes there are implicit relationships and ordering between APIs that do not get captured explicitly in the API interfaces.

    We actually have a project team that is setting up some testing pipelines to do org exports and imports. I know that for an internal hackathon I did exactly what you are looking to. Here were the results:

    1. We found about 70% of the resources provided by Terraform were exported successfully.
    2. We ran into a number of issues with data action credentials failing to re-import because we had not realized that the credentials were not (and should not) ever be exported.

    One of the biggest things to be aware of is that not all of the Genesys Cloud data objects are exposed through Terraform. This prevents you from using the tool to export and import the contents of one org into another. Right now the biggest candidates for import/export center around flows, data actions and integrations.

    I would really recommend you do targeted imports and exports. If you find any issues, please let me know as as I said, I am ramping up a few resources to focus on this because I would really love to have a robust mechanism for doing exactly what you are talking about.

    Thanks, John Carnell Manager, Developer Engagement


    system | 2022-03-31 13:41:37 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 13531