Hi, I've just updated to Pulumi 2 and fixing up th...
# typescript
b
Hi, I've just updated to Pulumi 2 and fixing up the new asynchronous code. How do I access a single subnet in an array of subnets of type
Promise<pulumi.Output<string>[]>
? This is for an ec2 instance subnet field.
I used to have
subnetId: vpc.publicSubnetIds[0]
s
You could try something like
Copy code
subnetId: vpc.publicSubnetIds.apply(s => s[0])
or maybe
Copy code
const subnet = vpc.publicSubnetIds.then((subnetId: string[]) => { return subnetId[0]});
b
thanks, I'll try that