damp-magazine-59707
02/29/2024, 10:18 PMpulumi
command itself reads its configuration (e.g., from ~/.pulumi/config.json
)? we'd like to set a default organization on a repo-wide basis, but trying to google basically any combination of "pulumi" and "config" comes up with stuff about pulumi project config handling.little-cartoon-10569
02/29/2024, 10:23 PMdamp-magazine-59707
02/29/2024, 10:25 PM% cat ~/.pulumi/config.json
{
"backends": {
"<https://api.pulumi.com>": {
"defaultOrg": "ohai"
}
}
}
the issue we're running into is that various automation APIs behave differently depending on whether or not you have a default org setdamp-magazine-59707
02/29/2024, 10:26 PMstack_outputs()
requires you to include the org name in the stack name if you don't have an org set, even if you've already selected a project. a project belongs to exactly one org, so that shouldn't be necessary, but it is. if you have a default org set, then that's not needed, and things like list_stacks()
don't include it, eitherlittle-cartoon-10569
02/29/2024, 10:26 PMlittle-cartoon-10569
02/29/2024, 10:26 PMdamp-magazine-59707
02/29/2024, 10:26 PMlittle-cartoon-10569
02/29/2024, 10:28 PMlittle-cartoon-10569
02/29/2024, 10:28 PMlittle-cartoon-10569
02/29/2024, 10:30 PMdamp-magazine-59707
02/29/2024, 10:31 PMlittle-cartoon-10569
02/29/2024, 10:32 PMdamp-magazine-59707
02/29/2024, 10:32 PMPULUMI_CREDENTIALS_PATH
, although I'm not sure that helps us much. https://github.com/pulumi/pulumi/blob/3b4715ae1b825edf8283a94c4990faf679964521/sdk/go/common/workspace/creds.go#L269-L286little-cartoon-10569
02/29/2024, 10:35 PMGetBackendConfigDefaultOrg()
. And since that's just getting the default, and not checking that the actual set value matches the default, it's not likely to do everything you need. You may be in a roll-your-own situation.