Context:
Environment: AU-1 BYOC
Provider: genesyscloud v1.22.0
Resource: genesyscloud_bot
Pushing intent training phrases via Terraform. The resource applies successfully for basic intents, but fails when adding specific regex patterns to the intent.training_phrases block.
Error:
Error: API returned error: Post "https://api.au-1.genesyscloud.com/api/v2/bots/12345/intents/67890": 422 Unprocessable Entity
Response body: {"errors":[{"code":"validation_failed","message":"Training phrase pattern contains invalid characters or length exceeds limit"}]}
The regex is valid in standard engines. Length is under 255 chars. Tested the same payload via Postman to the /api/v2/bots/:botId/intents/:intentId endpoint. Returns 200 OK.
Terraform state shows the intent exists but lacks the training phrase. Subsequent terraform apply attempts to add it again and hits the same 422.
Question:
Why does the Terraform provider fail to persist training phrases that the native API accepts? Is there a known serialization issue with special characters in the HCL block for bot intents in BYOC regions?