Backing up of System

Good Morning,

I'm working on a project where we backup our system. Management wants to get a monthly snapshot of the system that can be used to fall back too if we need too.

Now I don't think we need a way to push the config back up but we are looking at a way to download it.

Part of this project was looking at Terraform.

My question is this. I want to start with the users portion of the system.

I don't want to give my OAuth an admin role. Thats just... not the way it should be. So with that said I'm looking for some guidance on the rights that Terraform would need.

Any thoughts? Ideas? links to websites? Etc..?

Hello @Richard_Sutterfield

One way you can backup your genesyscloud resources is by maintaining their state via terraform.

You will have more details of this in Terraform Registry

you can either use client credentials or an access token.

to start with , if you want to backup users portion of the system , you can export all the users via export resource.

sample terraform export resource

provider "genesyscloud" {
}

resource "genesyscloud_tf_export" "export" {
  directory          = "./genesyscloud"
  resource_types     = ["genesyscloud_user"]
  include_state_file = true
}

More info can be see on export here Terraform Registry

Please let us know if you need more information.

Thanks
Hemanth

terraform {
required_version = "~> 1.10.4"
required_providers {
genesyscloud = {
source = "mypurecloud/genesyscloud"
version = "~> 1.0.0"
}
}
}

provider "genesyscloud" {
oauthclient_id = ""
oauthclient_secret = ""
aws_region = ""
}

resource "genesyscloud_tf_export" "export" {
directory = "./genesyscloud"
resource_types = ["genesyscloud_user"]
include_state_file = true
}

Here is my provider.tf file.. obvious with out the id and sec and region :wink: So all I should have to do is terraform apply and it will download the config? When it downloads is it in a readable format?

So commands in this order are
Terraform init - to build the system.
Terraform plan - to see what will be changed
terraform apply - to start the backup. Now I want to make sure this won't overwrite anything on my system right?

So looking at this it should be
Terraform import. Right?

Hi Richard,

So I want to provide some additional context. The export functionality will export the configuration of any Genesys Cloud objects available in CX as Code However, the export was never intended to be a point-and-click recovery tool. You can back up your config but you need to test applying it or at least having the config so that you can write a script to recover.

The terraform import command imports your existing state into your Terraform state file and you still have the HCL or Javascript.

The export functionality as a backup if something completely dropped or you need the config so you can still use the original config.

A long story short, it is still your responsibility to test re-applying the export. It is not a guaranteed backup and recovery solution.

Thanks,
John Carnell
Director, Developer Engagement

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