sparse-intern-71089
02/25/2021, 11:14 AMcolossal-australia-65039
02/25/2021, 6:30 PMconst stack = await LocalWorkspace.createOrSelectStack({
stackName: stackName,
workDir: upath.joinSafe(__dirname, "stack"),
})
if you don't already have one, it will create the Pulumi.stackname.yaml file for you when you run the code. This file doesn't need to be added to git in this case since the "source of truth" is the code, not the file itself, UNLESS you want to check in encrypted secrets. In that case the source of truth for the secrets would be the Pulumi.stackname.yaml file, but for non-secrets it could still be solely from the code. I think most people using this may still check in the stack config file though because it seems like it's a bridge between the "old way" of Pulumi to the new way using the automation API.
But if you use the inline API
const stacks = await LocalWorkspace.createOrSelectStack({
stackName: stackName,
projectName: "myes",
program: pulumiProgram
})
it will not create the file for you. It's not needed as the information is just in your code.
The point of the Automation API is to move away from config files and minimize CLI use, so it's intentional that these stack files are less important or obsolete with the automation API.lemon-agent-27707
02/25/2021, 8:04 PMworkDir
. If you don't specify one, we create one in a temp directory for you and this is where any pulumi.stack.yaml
files would end up if they get created as a side effect of setting config.lemon-agent-27707
02/25/2021, 8:06 PMprehistoric-kite-30979
02/26/2021, 4:14 PM