Could someone clarify why the genesyscloud_ai_bot resource fails with a 400 error during terraform apply?
The error message states: Invalid bot definition structure. Missing required field 'nluModelId' in training data configuration.
Environment:
- Provider: genesyscloud 2.18.1
- Region: ap-southeast-2
- Terraform: 1.7.0
The HCL block looks correct based on the Genesys Docs.
resource "genesyscloud_ai_bot" "test_bot" {
name = "Terraform-Bot-Test"
description = "Automated deployment test"
bot_definition = jsonencode({
"nluModelId" = "${data.genesyscloud_nlu_model.default.id}",
"trainingData" = [
{
"intentName" = "greeting",
"phrases" = ["hello", "hi"]
}
]
})
}
The nluModelId is populated correctly during the plan phase. The API call to POST /api/v2/bots/ai returns the 400 status. Manual creation via UI works fine with same parameters. Is there a schema mismatch in the provider version? Or a specific JSON structure requirement for the bot_definition field that is not documented?
Using GitHub Actions for deployment. Logs show the payload is valid JSON. No 429s or timeouts. Just straight 400. Appreciate any insights on the expected JSON payload structure for bot_definition.