Skip to content

Instantly share code, notes, and snippets.

@cnunciato
Created February 28, 2021 16:51
Show Gist options
  • Select an option

  • Save cnunciato/07f70c30285450fde6a998c5288d39da to your computer and use it in GitHub Desktop.

Select an option

Save cnunciato/07f70c30285450fde6a998c5288d39da to your computer and use it in GitHub Desktop.
Get the outputs from a Pulumi stack with a Node.js program
const automation = require("@pulumi/pulumi/x/automation");
async function getStackOutputs(stackName, projectName) {
const stack = await automation.LocalWorkspace.selectStack({
stackName,
projectName,
program: () => {},
});
return await stack.outputs();
}
(async () => {
const outputs = await getStackOutputs("dev", "website-next");
console.log(outputs);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment