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.
cuddly-flower-91328
10/26/2023, 5:38 PM
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.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.