Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

davinci_flow resource: "Unmapped node connection" warning #272

Open
patrickcping opened this issue Mar 19, 2024 · 0 comments
Open

davinci_flow resource: "Unmapped node connection" warning #272

patrickcping opened this issue Mar 19, 2024 · 0 comments

Comments

@patrickcping
Copy link
Contributor

Observed Warning

The provider may respond to terraform validate, terraform plan and terraform apply commands with warnings similar to the following:

│ Warning: Unmapped node connection
│ 
│   with davinci_flow.test-flow-1,
│   on ad-hoc-davinci.tf line 2, in resource "davinci_flow" "test-flow-1":
│    2: resource "davinci_flow" "test-flow-1" {
│ 
│ The flow JSON to import (provided in the `flow_json` parameter) contains a node connection that does not have a
│ `connection_link` mapping.  This behaviour is deprecated - going forward all connections in a flow must have a
│ `connection_link` block parameter defined.
│ 
│ Consider using the `davinci_connection` resource (to create a Terraform managed connection) with the
│ `davinci_flow.connection_link` parameter (to map the Terraform managed connection with the connection in the flow).
│ 
│ Connection ID: 53ab************************1ac8
│ Connector ID: errorConnector
│ Connection Name: Error Message
│ Node Type: CONNECTION
│ Node ID: 2pzouq7el7
│ 
│ (and 2 more similar warnings elsewhere)

Applicable DaVinci Provider Versions

>= 0.3.0

Explanation

Flows, when exported from the DaVinci servoce, contain nodes in the designer UI that use connection instances that are configured under the "Connections" menu item. These connection instance links are included in the flow export, and must be re-mapped to new admin defined connections when migrating flow configuration through environments using Terraform.

In versions < 0.3.0 of the provider, leaving connections unmapped was tolerated as the DaVinci service creates the connections implicitly or uses connections automatically seeded as example configuration when the environment was created. However this represents a loss of Terraform control over the connections, and can cause breaking issues if the seeded/implicitly created connection definitions change at a later stage.

Therefore, leaving connections unmapped in the davinci_flow resource is now considered deprecated, and all node connections must be mapped using the davinci_flow.connection_link parameter.

Resolution

In the above warning, the davinci_flow.test-flow-1 definition in HCL must be updated:

HCL that produces the warning

resource "davinci_flow" "test-flow-1" {
  environment_id = pingone_environment.my_environment.id

  flow_json = file("./flows/full-minimal.json")
}

Notice that the connection details in the warning does not have a mapping defined in the davinci_flow resource.

HCL that resolves the warning

resource "davinci_connection" "test-error" {
  environment_id = pingone_environment.my_environment.id
  connector_id   = "errorConnector"
  name           = "my-new-error"
}

resource "davinci_flow" "test-flow-1" {
  environment_id = pingone_environment.my_environment.id

  flow_json = file("./flows/full-minimal.json")

  connection_link {
    id                           = davinci_connection.test-error.id
    name                         = davinci_connection.test-error.name
    replace_import_connection_id = "53ab************************1ac8"
  }
}

Notice that:

  • The davinci_connection.test-error connector has been defined, to be managed by Terraform
  • The connection_link.replace_import_connection_id value in the davinci_flow.test-flow-1 definition relates to the "Connection ID" in the warning. This configuration means that any node connection in the flow export that uses this connection ID will be replaced with the new connector details defined in connection_link.id and connection_link.name.

FAQ

  • I've mapped the connection in HCL, saved the file and I still see the error. What do I do? - Raise a bug report with us using this link
  • How do I get the connection IDs without having to view the warnings in the Terraform process - In the DaVinci console for the source system (the environment where the flow is exported from), each connection is defined in the "Connectors" menu. You can use Terraform to create these connections using the davinci_connection resource, and each connection in the admin console is displayed with the ID to use in the connection_link.replace_import_connection_id parameter of the davinci_flow resource.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant