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

microscopic-flower-40914

08/12/2020, 6:14 AM
Another question: After creating subnets my functions returns []*ec2.Subnet, but in ElasticBeanstalk I need to add them to EnvironmentSettingArray with EnvironmentSettingArgs {Name: pulumi.String("Subnets"), NampeSpace: pulumi.String("awsec2vpc"), Value: pulumi.String("subnetid1,subnetid2,subnetid3")} However how can I create a comma seperated string from the array, as when I do fmt.Sprintf("%v,%v,%v",subnet[0].ID(),subnet[1].ID(),subnet[2].ID()) I only get the pointers, not the real value as this is filled at deployment time and not after creation.
i

important-appointment-55126

08/12/2020, 1:33 PM
you likely want
pulumi.Sprintf
which works similarly to
fmt.Sprintf
but knows to wait for outputs to resolve before formatting the string - See https://www.pulumi.com/docs/intro/concepts/programming-model/#outputs-and-strings
👍 1
m

microscopic-flower-40914

08/12/2020, 2:01 PM
How could I have missed this, thanks for the help. It worked.
🎉 1
3 Views