Using genesyscloud_tf_export into github actions

Hello everyone,

I am trying to execute a simple terraform piece of code in GitHub Actions in order to create and automatic export pipeline. When I execute this code locally it works correctly and then the genesyscloud.tf file gets created. But when I do it via GitHub actions and Terraform Cloud the file can't be stored for some reason. I know that the Terraform Cloud workspace gets deleted when the job ends but I think there should be a way to store this output file somewhere in our github repo.

resource "genesyscloud_tf_export" "export" {
directory = "$GITHUB_WORKSPACE/Export"
resource_types = []
include_state_file = true
export_as_hcl = true
log_permission_errors = true
}

This is the code. What can I do in order to save the exported .tf file into the repo or elsewhere? Any workarounds? Am I not going in the good way?

Thanks everybody beforehand!

Hi Isusko,

One way you could do this is to store the item as an artifact as part of the build. The containers that run a GitHub action are ephemeral and go away from the action is complete. Artifacts stay with the build (though I don't know for how long). You can take a look at a github action that can upload an artifact.

While a CX as Code export does export most resource definitions you keep the following in mind:

  1. Not all objects in Genesys Cloud are supported yet in CX as Code so it is not a true backup.
  2. Our exports only the configuration of a Genesys Cloud object. If there was an artifact associated with the flow (e.g. a prompt wav file, an Architect flow, etc....) the actual file will not be exported.
  3. While the export can be used as part of a homegrown backup process it is not intended to be a backup and recovery solution. It is the responsibility of the customer to build and test this type of solution using their Terraform exports.

I hope that helps.

Thanks,
John Carnell
Manager, Developer Engagement

Hello John,

We have been doing many tries today and finally we decided that using github artifacts will work for us as it fulfills our needs.

Thank you,
Isusko Sallen Latatu

Hi Isusko,

Glad to hear it worked.

  • John

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