`for (let i = 0; i < pulumi.output(subnets).app...
# typescript
k
for (let i = 0; i < pulumi.output(subnets).apply(x => x.length); i++ ) {
// do something with subnets[i]
}
d
Copy code
pulumi.output(subnets).apply(subnets => {
  for (let i = 0; i < subnets.length; i++ ) {
    // do something with subnets[i]
  }
})
this should work
👍 1
apply<U>(func: (t: T) => Promise<U>): Output<U>
it's still an output outside the callback
The result remains a Output so that dependent resources can be properly tracked.
👍 1
k
Thanks @dazzling-sundown-39670!