Open patrickcping opened 8 months ago
Hi @patrickcping, I don't know, but I assume, that either the sub-flow or the main flow has got the problem, that it might reference a flowConnector that does no longer exists?
In our environment, we have exactly one instance of the flowConnector defined, which is referenced / used by all flows.
I have imported that existing one into my terraform state and defined it with the same parameters in my terraform file.
I then define all sub-flows, before I try to apply the main flow using depends_on
to clarify the dependencies between the flows, i. e. that the main flow depends on the sub-flows first. Thus, I never saw your warning yet.
data "davinci_connections" "read_all" {
environment_id = var.environment_id
}
resource "davinci_connection" "flow_connector" {
connector_id = "flowConnector"
name = "Flow Connector"
environment_id = var.environment_id
depends_on = [data.davinci_connections.read_all]
}
resource "davinci_flow" "login_subflow" {
environment_id = var.environment_id
flow_json = file("flows/login-subflow.json")
connection_link {
id = davinci_connection.flow_connector.id
name = davinci_connection.flow_connector.name
}
depends_on = [davinci_connection.flow_connector]
}
resource "davinci_flow" "login_mainflow" {
environment_id = var.environment_id
flow_json = file("flows/login-mainflow.json")
deploy = true
connection_link {
id = davinci_connection.flow_connector.id
name = davinci_connection.flow_connector.name
}
subflow_link {
id = davinci_flow.login_subflow.id
name = davinci_flow.login_subflow.name
}
depends_on = [davinci_connection.flow_connector, davinci_flow.login_subflow]
}
Hope using depends_on
solves your issue.
Kind regards
Observed Warning
The provider may respond to
terraform validate
,terraform plan
andterraform apply
commands with warnings similar to the following:Applicable DaVinci Provider Versions
>= 0.3.0
Explanation
Flows, when exported from the DaVinci service, can contain "flow connector" nodes in the designer UI that directly reference subflows. These subflow links are included in the flow export, and must be re-mapped to new admin defined subflows when migrating configuration through environments using Terraform.
Leaving subflows unmapped in the
davinci_flow
resource is now considered deprecated, and all subflows referenced in "flow connector" nodes must be mapped using thedavinci_flow.subflow_link
parameter.Resolution
In the above warning, the
davinci_flow.test-flow-1
definition in HCL must be updated:HCL that produces the warning
Notice that while the flow connector connection has been remapped using the
connection_link
parameter, the subflow that it references has not.HCL that resolves the warning
Notice that:
davinci_flow.test-subflow-1
subflow has been defined in it's owndavinci_flow
resource definition, to be managed by Terraformsubflow_link.replace_import_subflow_id
value in thedavinci_flow.test-flow-1
definition relates to the "Subflow ID" in the warning. This configuration means that any subflow in the flow export that uses this ID will be replaced with the new subflow definition details defined insubflow_link.id
andsubflow_link.name
.FAQ