Genesys Cloud Analytics Dashboard Terraform Import Fails with 400 on Custom Widgets

Looking for advice on importing existing Analytics Dashboards into Terraform state. The standard dashboard resource imports correctly, but custom widgets defined within the dashboard fail during the terraform import command.

We are using the Genesys Cloud Terraform provider v1.18.2. The goal is to migrate our staging environment dashboards to a code-first workflow. The dashboard itself imports without error. However, when attempting to import the associated custom widget definitions, the provider returns a 400 Bad Request. The error message is generic: “Invalid input.”

The environment details are as follows:

  • Provider: genesyscloud v1.18.2
  • Region: AU
  • Terraform Version: 1.6.4
  • Dashboard Type: Custom Analytics Dashboard
  • Widget Type: Custom SQL/Aggregation Widget

The HCL block for the widget matches the API schema exactly. I have verified the JSON structure against the OpenAPI spec. The widget ID is valid and exists in the org. The dashboard ID is correct.

resource "genesyscloud_analytics_dashboard_widget" "custom_metric" {
 dashboard_id = genesyscloud_analytics_dashboard.main.id
 widget_id = "existing-widget-id-from-api"
 # ... other fields
}

Running terraform import genesyscloud_analytics_dashboard_widget.custom_metric {dashboardId}/{widgetId} fails. The debug logs show the provider sending a GET request to retrieve the widget config, which succeeds. Then it attempts to reconcile the state. The failure occurs at the validation step.

Is there a known issue with importing custom widgets that use complex aggregation functions? The standard out-of-the-box widgets import fine. This seems isolated to custom definitions.

Any pointers on debugging the validation logic would be appreciated. The current workaround is manual creation, which defeats the purpose of the IaC pipeline. We need this for automated promotion across environments.