This message was deleted.
# aws
s
This message was deleted.
l
The publicSubnetIds array is automatically lifted. Don't use
apply()
.
subnetId: vpc.publicSubnetIds[0]
works fine.
f
I tried but it says
1. Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'Promise<Output<string>[]>'.
Property '0' does not exist on type 'Promise<Output<string>[]>'.
l
Ah, that's awsx for you. Promises instead of outputs. Is there an equivalent method / member that gives outputs?
If not, then you can wrap the value in an output. That'll allow Pulumi to lift the values correctly.
I think this should do it?
Copy code
subnetId: pulumi.output(vpc.publicSubnetIds)[0]
f
It works! Thanks, brother.