Deploying a complex agent script via Terraform provider v1.15.4 in AP-1 BYOC environment. The apply fails with HTTP 400 Bad Request. Error message indicates invalid JSON structure in the blocks attribute.
The script contains ~150 blocks including nested conditional logic and data actions. Manual creation via Architect UI works without issues. Suspect payload size or specific character encoding in the HCL definition.
Relevant resource snippet:
resource "genesyscloud_script" "main_agent_script" {
name = "Complex Onboarding Script"
description = "Auto-generated via IaC"
blocks {
id = "block_001"
type = "text"
text = "Welcome to the support team. Please review the following documentation..."
# ... 149 more blocks ...
}
}
Error log:
Error: POST /api/v2/scripts: 400 Bad Request
{ "code": "invalid_request", "message": "Invalid block structure at index 45" }
Has anyone successfully deployed scripts with high block counts via Terraform? Is there a known limit or a specific formatting requirement for the blocks array that differs from the API spec? Current workaround is importing existing scripts, but need true IaC control for env promotion.