sparse-intern-71089
06/25/2020, 10:27 PMsalmon-account-74572
06/25/2020, 10:30 PMec2.NewSubnet) across AZs within a region, and then I "capture" the ID of the created subnets in an array (this happens near the end of a for loop):
pubSubnetIds[idx] = subnet.ID()
Later, I can reference that array when I create a NAT Gateway with `ec2.NewNatGateway`:
SubnetId: pubSubnetIds[0],
However, I can't do the same thing with route table associations in a for loop:
SubnetId: pubSubnetIds[idx],
In that usage, Pulumi reports that "cannot use privSubnetIds[idx] (type pulumi.StringInput) as type pulumi.StringPtrInput in field value". I get that they are different types (apparently), but...
a) why are they apparently different types between resources?
b) how is someone supposed to know this other than trial-and-error?
c) what is the workaround/solution?salmon-account-74572
06/25/2020, 10:34 PMwet-egg-6347
06/25/2020, 11:00 PMsalmon-account-74572
06/25/2020, 11:05 PMsalmon-account-74572
06/25/2020, 11:09 PMlemon-agent-27707
06/25/2020, 11:31 PMlemon-agent-27707
06/25/2020, 11:34 PMsubnet.ID() is a pulumi.IDOutput which implements pulumi.StringOutput and pulumi.IDPointerOutpur but not pulumi.StringPointerOutput.lemon-agent-27707
06/25/2020, 11:34 PMlemon-agent-27707
06/25/2020, 11:47 PMsalmon-account-74572
06/26/2020, 3:30 PMlemon-agent-27707
06/26/2020, 3:32 PMsalmon-account-74572
06/26/2020, 3:33 PMmodule aws-get-azs
go 1.14
require (
<http://github.com/pulumi/pulumi-aws/sdk/v2|github.com/pulumi/pulumi-aws/sdk/v2> v2.0.0
<http://github.com/pulumi/pulumi/sdk/v2|github.com/pulumi/pulumi/sdk/v2> v2.0.0
)lemon-agent-27707
06/26/2020, 4:04 PMStringInput and other input methods that implement the corresponding ptr type don't have the appropriate methods declared on their interfaces even thought the methods are implemented. The type error goes away when I make this change to my SDK locally.lemon-agent-27707
06/26/2020, 4:14 PMsalmon-account-74572
06/26/2020, 4:27 PMsalmon-account-74572
06/30/2020, 6:24 PMlemon-agent-27707
06/30/2020, 6:56 PM<http://github.com/pulumi/pulumi/sdk/v2|github.com/pulumi/pulumi/sdk/v2> v2.5.1-0.20200630183524-a8a20ecb4b1d
and then run go mod downloadlemon-agent-27707
06/30/2020, 6:57 PMsalmon-account-74572
06/30/2020, 6:59 PMsalmon-account-74572
07/01/2020, 8:16 PMgo.mod and ran go mod download, and I can confirm that it did fix the original problem (although VS Code's Go IntelliSense still thinks there's a problem). Unfortunately, now all instances of using Pulumi.Map to create AWS tags are broken. I'll create a separate thread to discuss that.