https://pulumi.com logo
#general
Title
# general
s

sparse-tomato-5980

07/15/2021, 7:27 PM
Hi! I may have found a bug in `pulumi config get`:
Copy code
pulumi config --config-file ./Pulumi.testing.yaml get --path artifacts.analyzer_dispatcher
error: configuration key 'artifacts.analyzer_dispatcher' not found for stack 'jun10'
the question: why is it looking at my currently-selected stack
jun10
and not the config file I specified? according to the man page:
Copy code
--config-file string           Use the configuration values in the specified file rather than detecting the file name
b

bored-oyster-3147

07/15/2021, 7:38 PM
have you tried putting the
--config-file
flag after the
get
command?
docs say
pulumi config get <key> [flags]
b

billowy-army-68599

07/15/2021, 7:40 PM
@sparse-tomato-5980
--config-file
refers to your
Pulumi.yaml
file (ie, the one you use to specify your runtime, name etc) if you want to specify a specific stack file, use
-s
s

sparse-tomato-5980

07/15/2021, 7:43 PM
Got it, makes sense. Okay - the next question is, I'm actually _grabbing a Stack file from another branch and copying config values out of it_; so, the stack doesn't actually exist as far as pulumi knows
any way to do that or not really
b

billowy-army-68599

07/15/2021, 7:44 PM
yeah that won't work, stacks are local to your project, the stack config values also exist in your state. if you want to do something like this, you'll need to either: 1) output the stack config as an exported output and use a stack reference 2) use the automation API at a higher level to read the stack config 3) use a wrapper script to grab the values from the stack config file
1
s

sparse-tomato-5980

07/15/2021, 7:45 PM
kk, that works for me. thanks.
(tbh this is more of a hacky script - no need for a stack reference to another concrete stack - so I might just do some yaml manipulation)