https://pulumi.com logo
#getting-started
Title
# getting-started
w

witty-vegetable-61961

01/31/2022, 10:40 PM
hi guys, still in the "getting started" phase of Pulumi. With output variables, what are my optins to push them into other programs? I could write c# code in the Pulumi program and push that into octopus as a variable, or are there are any other methods? In my case, I want to use the property of something I provision as a variable fgor an octopus deployment.
e

echoing-dinner-19531

02/01/2022, 9:25 AM
You can use the pulumi cli to write out stack outputs as a json blob, e.g:
Copy code
$ pulumi stack output --json --stack dev
{
  "bucketName": "my-bucket-026fb45",
  "codeId": "arn:aws:codebuild:us-west-1:616138583583:project/project-ba84a1b"
}
w

witty-vegetable-61961

02/01/2022, 11:23 PM
hmm I ran that command but it says stack dev cant be found? but i have a dev stack.
e

echoing-dinner-19531

02/01/2022, 11:36 PM
What does
pulumi stack ls
show?
w

witty-vegetable-61961

02/01/2022, 11:39 PM
I fixed this by running pulumi stack select dev -c, so now the command doesn't error out.
Note I have not yet defined output variables. Maybe its a bug in the cli.
ah looking at the vstacks the first was gurdips1/dev
e

echoing-dinner-19531

02/01/2022, 11:45 PM
Yeh it might not of been able to auto fill the project name depending on what your directory was when you ran
stack output
w

witty-vegetable-61961

02/01/2022, 11:48 PM
This raises a few Questions. When I am running pulumi commands, I notice a lot of them don't speicfy a project name. So presumably should be run in the directory of the project?
with the stack output command, the output variable is a secret, how can I get the actual plaintext value?
e

echoing-dinner-19531

02/01/2022, 11:49 PM
They don't have to be run from the project directory, but if you run them from elsewhere you need to tell it which project you mean. If you run it from the project directory the cli can auto-fill the project name based on the Pulumi.yaml it finds.
Copy code
$ pulumi stack export --help
...
      --show-secrets false   Emit secrets in plaintext in exported stack. Defaults to false
w

witty-vegetable-61961

02/01/2022, 11:54 PM
ah gotcha! That's helpful on both of my questions. On another note, I deployed my first pulumi program and was a breeze.
🙌 1
6 Views