https://pulumi.com logo
Title
p

proud-pizza-80589

10/13/2022, 3:06 PM
ok, i’m losing it i think, given an array like this
Output<string>[]
how the hell do i JSON.stringify it so i get a single string with the json serialised into it
const list: string[] = [];
    for (const x of resourceList) {
      interpolate`${x.y}@${x.z}`.apply((z) => {
        list.push(z);
      });
    }
    const json = JSON.stringify(list)
my array is either emtpry or i end up with a Output<string>[] which can’t be stringified as is
m

millions-furniture-75402

10/13/2022, 4:39 PM
What will the JSON be used for?
p

proud-pizza-80589

10/13/2022, 4:40 PM
needed it in a configmap, but just figured it out
'static-nodes.json': all(validatorWallets.map((wallet) => wallet.wallet.enode)).apply((enodes) => {
            return JSON.stringify(
              enodes.map((enode, index) => `enode://${enode}@besu-${index + 1}:30303`),
              null,
              2
            );
          }),
the clue was the map in the all