Created
February 28, 2021 16:51
-
-
Save cnunciato/07f70c30285450fde6a998c5288d39da to your computer and use it in GitHub Desktop.
Get the outputs from a Pulumi stack with a Node.js program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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