pulumiverse / pulumi-talos

Pulumi provider for Talos
Mozilla Public License 2.0
38 stars 11 forks source link

Problem with composite output properties #93

Open ringods opened 5 months ago

ringods commented 5 months ago

This issue is to communicate the roadblock I bumped into while trying to map output types to specific generated Pulumi SDK types.

In the TF provider, one can pass a composite output from the talos_machine_secrets resource further downstream:

resource "talos_machine_secrets" "this" {}

data "talos_machine_configuration" "controlplane" {
  cluster_name     = var.cluster_name
  cluster_endpoint = var.cluster_endpoint
  machine_type     = "controlplane"
  machine_secrets  = talos_machine_secrets.this.machine_secrets # <-- composite output passed here
}

In Pulumi, the generated output types for the properties of talos.machine.Secrets resource are different from the generated input types of e.g. the function talos.machine.getConfiguration. This results in that we can't immediately pass the property downstream, resulting in issues like #80.

I discussed this with a few of the Pulumi product engineers, only to conclude that it currently is not possible to fluently pass composite outputs immediately as inputs downstream, and this consistently in all of Pulumi's supported programming languages.

This is definitely a first case of resources returning a composite type, so I file a feature request for this: https://github.com/pulumi/pulumi/issues/15883

In the meantime, I will investigate how to rework the Pulumi Talos Linux provider for the best user experience.