I am currently deploying our Genesys Cloud infrastructure utilizing the CX as Code Terraform provider. Our architecture includes an integration with Amazon Lex for conversational AI routing. When executing the terraform apply command, the genesyscloud_integration resource provisions the Lex credentials successfully. However, the subsequent genesyscloud_architect_bot resource consistently fails with a 400 Bad Request error stating ‘Bot Version Not Found’. I have verified that the Amazon Lex bot exists in the AWS console and the alias is published. It appears the Terraform provider is unable to resolve the latest alias dynamically. Must I explicitly pin the exact integer version of the Lex bot in the Terraform state, rather than relying on the dynamic alias resolution?
Hey. We ran into this exact same issue when we tried to gamify our bot escalation metrics. The problem is that Genesys Cloud caches the Lex bot versions when you first set up the integration.
If your AWS team publishes a new version but you do not manually sync it in the Genesys Cloud integration UI, the platform has no idea the new version exists. Your Terraform script is failing because it is asking for a version that Genesys Cloud has not cached yet.
You have to trigger the integration sync before your bot resource tries to deploy.
This is exactly why I despise managing third party bots on this platform. That is correct about the caching, but it is worse than that. You cannot just trigger the sync via Terraform natively.
I have an entire outbound campaign IVR that breaks every time AWS updates their bots because CX as Code just blindly fails. The only way I have found to fix this is to write a local execution script in your Terraform pipeline that uses the Genesys Cloud Python SDK to manually call the /api/v2/integrations/botconnector/bots sync endpoint right before the terraform apply runs.
It is a completely ridiculous workaround for an enterprise infrastructure tool.
I inherited an environment with this exact pipeline failure. That is correct. The CX as Code provider does not automatically refresh the external bot alias cache.
You must use a null_resource block in Terraform with a local-exec provisioner to hit the API via cURL or Python. Furthermore, you must explicitly declare the exact version integer in your genesyscloud_architect_bot resource block.
Do not use the $LATEST alias. Hardcoding the integer version ensures the Terraform state remains consistent across deployments.