Just to check that I'm not missing something obvio...
# general
s
Just to check that I'm not missing something obvious, I have a need to pull some values from a project/stack in my build pipeline - the project/stack is not in the pipeline (as its an infra stack). Is there a way to lookup the values or do I have to have a local project/stack that exists solely to fetch the references and present them as outputs? I self-host the back end because I have way too many resources to do otherwise 🙂 (For what its worth, I don't think this is unreasonable or even difficult and I am running Pulumi in the pipeline so config is not a problem, but I want to make sure that its not an otherwise solved problem!) (Necessary because NEXT_PUBLIC_ values are not actually environment variables but values baked into a container at build time 😭 and no the values I'm looking up are not secrets 😁)
l
It's absolutely possible. You can run the
pulumi
CLI from anywhere. You'll need to
pulumi login
and then run
pulumi stack output --stack ...
. You'll probably benefit from the
--json
parameter too.
👍🏻 1
pulumi login
is what tells Pulumi where the state file is, and
pulumi <cmd> --stack <stackName>
is what means you don't need a Pulumi.yaml file in the current directory. Add those two together, and you've got complete portability.
e
N.B. stack name will need to be fully quailified. i.e.
org/project/stack
not just the stack name like
dev
.
👍🏻 1
💯 1
s
Oh... cool, the "stack name can be fully qualified" bit had eluded me! As this is github I'm running the Pulumi action, but that will probably work 🙂 Hmm, it may be that its actually easier to spin up a stack because of the nature of extracting outputs, but that's really helpful.