https://pulumi.com logo
#golang
Title
# golang
c

cuddly-flower-91328

10/25/2023, 8:43 PM
I'm certain this has been answered before but this Slack instance only retains 90 days of history, but what is the magic combination to retrieve a
[]string
from an output? Getting this error:
Copy code
cannot convert vpce.VpcEndpoint.NetworkInterfaceIds (variable of type pulumi.StringArrayOutput) to type pulumi.StringArray
e

echoing-dinner-19531

10/26/2023, 1:58 PM
c

cuddly-flower-91328

10/26/2023, 2:02 PM
Yeah I’ve tried several incarnations of ApplyT and pulumi.ToStringArray, etc but still run into a similar result without being able to convert the output into something usable.
Basically whatever I try results in a similar message:
cannot use vpce.VpcEndpoint.ToVpcEndpointOutput().SubnetIds().ApplyT((func(ids []string) []string literal)) (value of type "<http://github.com/pulumi/pulumi/sdk/v3/go/internal|github.com/pulumi/pulumi/sdk/v3/go/internal>".Output) as pulumi.StringArray value in struct literal compiler (IncompatibleAssign)
e

echoing-dinner-19531

10/30/2023, 3:39 PM
What are you trying to pass this into that it expects a
StringArray
? Resource properties should be typed as
StringArrayInput
, if you have a
StringArrayOutput
there isn't any way to turn that into a plain
StringArray
except for within the ApplyT call.
c

cuddly-flower-91328

10/31/2023, 11:26 AM
Thanks, @echoing-dinner-19531! I believe I have sorted out the issue this weekend and I’m using StringArrayInput. At least currently my LSP isn’t complaining. I’m building a bunch of component resources for internal use/self service. I’m going to instantiate a resource today and verify what I have implemented works as expected, but it sounds like what I landed on matches with your reply so that’s good.
2 Views