I am currently trying to deploy an inherited Architect flow using ‘CX as Code’ (Terraform). I am getting a ‘Resource Dependency’ error during the terraform apply phase, saying that a specific ‘Data Action’ or ‘Queue’ referenced in the flow cannot be found, even though I have defined those resources in my .tf files. Is there a specific order in which resources must be created in CX as Code, or is the provider failing to resolve the dependencies automatically for complex Architect flows?
Hello Isa47. I am a DevOps engineer and I use CX as Code for all our production deployments. The Terraform provider is usually very good at resolving dependencies, but Architect flows are a special case because they are ‘Nested’ resources. You should use the depends_on meta-argument in your genesyscloud_flow resource to explicitly list all the Data Actions, Queues, and Prompts that the flow uses. This ensures that Terraform creates those objects before it tries to upload and publish the Architect flow.
Hey Isa47! I am an admin for a large enterprise in Japan and I have seen these Terraform errors many times. One thing to check is your ‘Division’ assignments. If your Data Action is in the ‘Home’ division but your flow is being created in a ‘Support’ division, the flow will fail to find the action even if it exists. Make sure all your referenced resources are in a division that the flow’s service account has permission to access!