TypeScript newbie here, so forgive the simple ques...
# typescript
s
TypeScript newbie here, so forgive the simple question. The example usage for the
getAvailabilityZones
function in
pulumi/@aws
shows the use of the
output
function to access the data returned by the function. However, the only way I was able to make it work was without the
output
function, like so:
Copy code
const rawAzInfo = aws.getAvailabilityZones({
    state: "available",
});
let azNames: Array<string> = rawAzInfo.names;
let numberOfAZs: number = azNames.length;
Am I missing/overlooking/not understanding something? Or is this an error in the docs?
w
The examples should work as written - if you can point at the specific one that doesn't - we could take a look. The change to make it so that the code you have above works as written is very recent, and we will be working on updating all examples to use this (simpler) approach.
s
That example may work as written, but for what I was trying to do (ascertain the number of AZs in the configured region) I could never make it work.
w
Got it. Yes - we will make sure to update all the examples to use the simpler synchronous approach once it has been rolled out to all providers.
👍🏻 1