Hey folks.
I’m trying to reference an existing Genesys Cloud flow in my Terraform configuration without hardcoding the ID. The plan is to use the genesyscloud_flow data source. I’ve checked the docs and it seems like I should be able to look it up by name. Here is the snippet I’m using:
data "genesyscloud_flow" "my_existing_flow" {
name = "Customer Service Main"
}
When I run terraform plan, it throws a validation error. The message says Error: No matching flow found for name: Customer Service Main. I know for a fact the flow exists. I can see it in the UI and I can fetch it via the API using /api/v2/flows?name=Customer Service Main. The API returns the correct JSON payload with the ID I need.
I’ve tried adding the description attribute as well, but that doesn’t help. I also tried using the exact name from the API response, character for character. No luck. Is there a specific formatting requirement for the name lookup? Maybe case sensitivity? I’ve checked and it matches exactly.
Another thought: could it be related to the environment or deployment status? The flow is published. I’m running this in a US East environment. My Terraform provider version is 1.20.0. I’ve also tried using the genesyscloud_routing_email_domain data source with a similar pattern and that works fine. So I’m confused why the flow lookup is failing.
Here’s the full error output from the CLI:
Error: No matching flow found for name: Customer Service Main
with data.genesyscloud_flow.my_existing_flow,
on main.tf line 15, in data "genesyscloud_flow" "my_existing_flow":
15: data "genesyscloud_flow" "my_existing_flow" {
I’ve also tried using the genesyscloud_flow_version data source, but that requires a version ID, which defeats the purpose of looking it up by name. I just need a way to get the current active ID for this flow so I can reference it in another resource. Any ideas on why the data source isn’t finding it? I’m stuck.