gorgeous-salesmen-27957
12/21/2023, 7:26 PMpulumi env run myorg/databricks-foo -- echo "my host is: $DATABRICKS_HOST"
considering my environment looks like this:
values:
databricks:
host: https://<hostname here>
environmentVariables:
DATABRICKS_HOST: ${databricks.host}
pulumiConfig:
databricks:host: ${databricks.host}
when I run:
eval `pulumi env get myorg/databricks-foo --value shell`
and then
echo "my host is: $DATABRICKS_HOST"
I get the expected output. I would expect pulumi env run
to make the env vars available to the command its running, but that's not the behavior I'm seeing.gorgeous-salesmen-27957
12/21/2023, 7:27 PMpulumi env run myorg/databricks-foo -- env
I see the expected values there, but when I try to use them, they are empty, happens regardless which command I'm runninglittle-cartoon-10569
12/21/2023, 7:28 PMlittle-cartoon-10569
12/21/2023, 7:29 PMlittle-cartoon-10569
12/21/2023, 7:29 PMgorgeous-salesmen-27957
12/21/2023, 7:30 PMlittle-cartoon-10569
12/21/2023, 7:30 PMgorgeous-salesmen-27957
12/21/2023, 7:33 PMpulumi env run myorg/env -- echo "host: ${DATABRICKS_HOST}"
?gorgeous-salesmen-27957
12/21/2023, 7:33 PMlittle-cartoon-10569
12/21/2023, 7:34 PMlittle-cartoon-10569
12/21/2023, 7:34 PMlittle-cartoon-10569
12/21/2023, 7:35 PMgorgeous-salesmen-27957
12/21/2023, 7:35 PMeval `pulumi env run ... --value shell`
which worksgorgeous-salesmen-27957
12/21/2023, 7:36 PMlittle-cartoon-10569
12/21/2023, 7:36 PMdry-keyboard-94795
12/21/2023, 7:38 PM$$DATABRICKS_HOST
gorgeous-salesmen-27957
12/21/2023, 7:38 PMlittle-cartoon-10569
12/21/2023, 7:38 PMgorgeous-salesmen-27957
12/21/2023, 7:39 PMExec
little-cartoon-10569
12/21/2023, 7:39 PM\$
? Or you could turn your double-quotes into single-quotes. I'm not optimistic though, since prevent the outer shell parsing the var would presumably also prevent the pulumi-spawned shell from doing it.gorgeous-salesmen-27957
12/21/2023, 7:39 PM$
is being sub'd w/ the proc:
my host is 38389{DATABRICKS_HOST}
little-cartoon-10569
12/21/2023, 7:39 PM$$
is wrong.little-cartoon-10569
12/21/2023, 7:41 PMpulumi env
works exactly the same was as the page you linked. chamber will have exacty the same problem if you use env vars on the command line. This isn't a problem with pulumi or chamber, it's a problem with the order of evaluation of env vars.little-cartoon-10569
12/21/2023, 7:41 PMdry-keyboard-94795
12/21/2023, 7:41 PMsh -c 'your command here'
gorgeous-salesmen-27957
12/21/2023, 7:42 PMchamber exec <ns> -- echo "my host is $DATABRICKS_HOST"
I get the expected outputlittle-cartoon-10569
12/21/2023, 7:42 PMlittle-cartoon-10569
12/21/2023, 7:42 PMgorgeous-salesmen-27957
12/21/2023, 7:44 PMunset DATABRICKS_HOST
little-cartoon-10569
12/21/2023, 7:45 PMlittle-cartoon-10569
12/21/2023, 7:45 PMgorgeous-salesmen-27957
12/21/2023, 7:47 PMdry-keyboard-94795
12/21/2023, 7:54 PMsh -c
?gorgeous-salesmen-27957
12/21/2023, 7:56 PMsh -c
-- this:
pulumi env run myorg/myenv -- sh -c 'echo my host is: $DATABRICKS_HOST'
gorgeous-salesmen-27957
12/21/2023, 7:56 PM