Terraform Not Detecting Newly Added Dependency in Architect Flow After Import

Hello Everyone,

I imported the Architect Flow dependency using Terraform with the following configuration:

main.tf
resource "genesyscloud_tf_export" "export_flow" {
directory = "./genesyscloud/flow"
export_as_hcl = true
log_permission_errors = true
include_state_file = true
enable_dependency_resolution = true
split_files_by_resource = false
include_filter_resources = ["genesyscloud_flow::Name Of Callflow"]
}

After running terraform plan and terraform apply, all dependencies were successfully imported, and the state file was created in a separate folder (./genesyscloud/flow/genesys.tf).

Now, I have added another dependency (e.g., a datatable) to my Architect Flow. However, when I run terraform plan again, it shows "no changes", meaning the newly added dependency is not being detected.

How can I track newly added dependencies in Architect Flow after the initial import?

Thanks,
Klinton

Hi Klinton,

Did you add another dependency to the flow via the Architect UI or via Terraform?

Hi Charlie,

I adding dependency via the Architect UI

Thanks,

Hi Klinton,

Architect flows do not participate fully in the dependency graph as the flows are in a Domain Specific Language (DSL) independent of Terraform. When you export and turn on dependency resolution, we can use some of the public APIs to figure out dependencies and automatically export them. However, if you make changes in the Architect flow, you need to explicitly set the dependency using the depends_on keyword or reexport the flow and apply them back to your Terraform file.

Thanks,
John Carnell
Director, Developer Engagement

2 Likes

Hi @John_Carnell

Thank you for your answers.

Before re-exporting the flow with a new dependency, should I remove the previously generated terraform.tfstate file from my directory? Or is there a better approach?

Since terraform.tfstate compares the current state with main.tf, if I don’t modify main.tf but add a dependency in the Architect UI, Terraform still shows "no changes to apply." This happens because the new dependency isn't reflected in terraform.tfstate.

Should I delete terraform.tfstate, or is there a better way to handle this?

Thanks,
Klinton