pulumiverse/terraform-provider-pulumi

provider cannot handle non-string Pulumi outputs

Opened this issue · 0 comments

jf commented

Is your feature request related to a problem? Please describe.

I do not use only strings for my Pulumi outputs. For my vpc project, for instance, I find it helpful to be able to export a list of subnet ids (which is basically a list of subnet_resource.ids). However, it looks like this provider cannot handle the non-string output:

│ Error: stack_outputs.public_subnet_ids: '' expected type 'string', got unconvertible type '[]interface {}'
│
│   with data.pulumi_stack_outputs.stack_outputs,
│   on providers.tf line 14, in data "pulumi_stack_outputs" "stack_outputs":
│   14: data "pulumi_stack_outputs" "stack_outputs" {

Describe the solution you'd like

Terraform can handle outputs that are lists. I'd like this provider to be able to do the same.

Describe alternatives you've considered

I'm not sure if this is even a good workaround (because even this requires work done to the provider, whereas we could just do the work to support lists instead), but terraform-provider-pulumi could translate a list into individual outputs.

So in the case of a Pulumi output called public_subnet_ids, the provider would provide access to the following:

public_subnet_ids_count
public_subnet_ids_0
public_subnet_ids_1
...