What is the best way to convert a StringOutput or ...
# golang
r
What is the best way to convert a StringOutput or StringPtrOutput to StringArrayOutput. I have tried the following, but it doesn't seem to work. Any help will be appreciated. vpcSgId := cluster.EksCluster.ApplyT(func(eksCluster *awseks.Cluster) pulumi.StringArrayOutput { return eksCluster.VpcConfig.ClusterSecurityGroupId().ApplyT(func(sgId *string) pulumi.StringArray { return pulumi.StringArray{pulumi.String(*sgId)} }).(pulumi.StringArrayOutput) })
answer my own question, this seem to work vpcSgId := cluster.EksCluster.ApplyT(func(eksCluster *awseks.Cluster) pulumi.StringArrayOutput { return eksCluster.VpcConfig.ClusterSecurityGroupId().ApplyT(func(sgId *string) []string { return []string{*sgId} }).(pulumi.StringArrayOutput) })
However this doesn't help me in the following case when an input expects pulumi.StringArraryInput. as vpcSgId in this case is type of pulumi.Output (it is a nested output), why cannot it automatically flatten the nested Output when passed as an argument to another resource creation?