Hello, I'm trying to do my first steps with automa...
# automation-api
h
Hello, I'm trying to do my first steps with automation-api and following the example in https://github.com/pulumi/automation-api-examples/tree/main/nodejs/pulumiOverHttp-ts I got the problem with passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables even if I do: export PULUMI_CONFIG_PASSPHRASE="" curl --header "Content-Type: application/json" --request POST --data '{"id":"hello3","content":"hello world\n"}' http://localhost:1337/sites {"commandResult":{"stdout":"Created stack 'hello3'\n","stderr":"error: passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables\n","code":255},"name":"CommandError"} surely I'm making some mistakes but can't realize yet
f
Is that environment variable set in the shell process that’s running the server? In what you’ve pasted above, it looks like you’re setting it in the shell where you’re running curl.
h
yes you are right, thanks!!
l
@hundreds-receptionist-31352 you can also set these environment variables on the workspace. You should be able to do this at the time you create your stack. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/x/automation/#LocalWorkspace-envVars Then every command will have them. But you will have to update all usages of LocalWorkspace.create/select stack, or anywhere that a LocalWorkspace is created. Those methods take an optional third parameter where you can set env vars on init: https://github.com/pulumi/automation-api-examples/blob/main/nodejs/pulumiOverHttp-ts/index.ts#L73
h
Thanks Evan, I'll take a look at that too