Terraform Plan Failure - Data Action Parameter Override with API Version Mismatch

The terraform plan consistently fails when attempting to deploy a Data Action with a parameter override targeting the Genesys Cloud Predictor API. It appears the parameter override isn’t correctly translating the expected data type for the ‘languageCode’ parameter. This is happening specifically within a CI pipeline run against a dedicated testing organization. We’ve established the pipeline is successfully authenticating and can deploy Data Actions without overrides, so the core connectivity isn’t the issue.

The plan output shows the following error - a 400 Bad Request - returned from the Predictor API when attempting to create the Data Action. The API endpoint being called is /api/v3/predictor/languages, and the error message details an invalid type for the ‘languageCode’ parameter, expecting a string but receiving an integer. It’s a bit perplexing because the Terraform configuration explicitly defines this parameter as a string. I suspect an issue with the conversion happening during the plan execution, or perhaps an incorrect API version being negotiated. The Data Action itself is relatively simple; it’s solely for language detection via the Predictor service.

Here’s a summary of the environment and steps taken:

  • Terraform version: 1.6.6
  • Provider version: hashicorp/genesyscloud 3.2.1
  • CI environment: GitHub Actions, Ubuntu-latest runner
  • Great Cloud region: EU-West
  • Data Action SDK version: v8.5.1.0
  • Workflow YAML triggering on pull requests to the ‘main’ branch
  • Reproducible in CI, but not locally when applying the same configuration.
  • Confirmed the Predictor API endpoint /api/v3/predictor/languages is the correct one based on documentation.
  • Verified that the parameter definition in the Terraform configuration is a string.
resource "genesyscloud_dataaction" "predictor_lang_detect" {
 name = "Predictor Language Detect"
 description = "Detects language from input text"
 type = "http"
 api_url = "https://api.genesyscloud.com/api/v3/predictor/languages"
 method = "POST"

 parameter {
 name = "languageCode"
 type = "string"
 value = "en-US"
 }
}

The problem persists despite ensuring the parameter type is correctly defined. I’m questioning if the provider is somehow defaulting to an older API version during the plan stage, causing it to misinterpret the parameter type. The pipeline setup hasn’t been altered recently, which makes this even less obvious.

Hey all,

So - this is probably a really basic thing, sorry if it is. Been banging my head against this for hours. The terraform plan failing with the data action parameter…it smells like an API version mismatch to me. We’re on v12.1.0 in Tokyo and the Predictor API seems to have some weird quirks.

  • First - check the Terraform provider version. Seems obvious but it’s usually something dumb. We’ve had issues where Terraform gets stuck on an older provider and the API has moved on.

  • Second - try explicitly setting the API version in the genesys_cloud_data_action resource. Something like this -

resource "genesys_cloud_data_action" "example" {
 name = "Example Data Action"
 data_action_type = "Predictor"
 api_version = "6.0" # Or whatever the latest is - seriously, check the docs
 parameters = {
 "languageCode" = "en-US"
 }
}
  • I ran a quick test - didn’t get far, honestly. The logs just cut off mid-request. It’s a POST to /api/v2/predictor/dataactions, and the headers…well, they should have the Accept header set to application/json. But the logs just end there. It’s probably a rate limit thing.

  • Also - the languageCode parameter needs to be a string. I know, again, obvious. But Terraform can be… finicky about types. Saw a case last month where it was trying to pass an integer.

  • Finally - and this might be a stretch, but have you checked the organization’s feature enablement? Some of the newer Predictor features are disabled by default.

Sorry the logs are incomplete. I’m still getting used to debugging Terraform.