Terraform Export

Hi Developers,
I am using terraform with Git actions to export all the data as a backup on daily basis but I am getting API time out error mostly all the times:
This is the terraform I am running:
terraform {
required_version = "~> 1.5.3"
required_providers {
genesyscloud = {
source = "mypurecloud/genesyscloud"
version = "~> 1.22.0"
}
}
}

provider "genesyscloud" {
oauthclient_id = "${var.oauthClientId}"
oauthclient_secret = "${var.oauthClientSecret}"
aws_region = "eu-central-1"
}
resource "genesyscloud_tf_export" "export" {
directory = "./genesyscloud"
include_state_file = true
export_as_hcl = true
}
and this i the error I am getting
│ Error: Failed to get page of knowledge documents: API Error: 408 - API Error: 408 Request Timeout (d8d44164-b2ed-4942-8f9f-2870f2bd8e3b)

54

55│ with genesyscloud_tf_export.export,

56│ on main.tf line 24, in resource "genesyscloud_tf_export" "export":

57│ 24: resource "genesyscloud_tf_export" "export" {

58

59

60Error: Terraform exited with code 1.

61Error: Process completed with exit code 1.

Knowing that even with filtering the Data for more than one data resources I am getting the same error, Can Anyone help in that , Please?

Regards
Nser Katerji

@Nser_Katerji

The latest version of the provider is v1.56.1. Can you upgrade version you are using and try again.

Regards,
Declan

Thanks @Declan_ginty I have tried that but still throwing same error

In addition to using the latest provider, I would recommend trying a recent version of the Terraform binary as well. They are currently up to v 1.10.5 and I've noticed a lot of performance improvements since 1.5.

Rather than use an exclude filter with export, maybe try include_filter_resources with a single resource and work your way up from there.

Edit: Another resource I use to troubleshoot is the API Usage report. Run it for the OAuth client you use for Terraform and export to CSV, it may indicate which API endpoints are causing the 408 errors.

2 Likes

Thanks @Adam_Long will try that and confirm :slight_smile:

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