brave-angle-33257
04/05/2021, 10:37 PMconst args = {
stackName: <http://message.SK|message.SK>,
projectName: "inlineNode",
program: pulumiProgram,
projectSettings: {
backend: {
url: "<s3://mycompany-bucket?region=us-west-2>"
}
}
};
const stack = await auto.LocalWorkspace.createOrSelectStack(args);
PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions
// Create our stack
const args = {
stackName: <http://message.SK|message.SK>,
projectName: "inlineNode",
program: pulumiProgram,
projectSettings: {
backend: {
url: "<s3://mycompany?region=us-west-2>",
},
},
};
// do the pulumi login
execSync(`pulumi login --cloud-url "<s3://mycompany?region=us-west-2>"`);
// create (or select if one already exists) a stack that uses our inline program
const stack = await auto.LocalWorkspace.createOrSelectStack(args);
2021-04-05T23:13:39.161Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO successfully initialized stack
2021-04-05T23:13:39.161Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO installing plugins...
2021-04-05T23:13:39.257Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO plugins installed
2021-04-05T23:13:39.257Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO setting up config
2021-04-05T23:13:39.808Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO config set
2021-04-05T23:13:39.808Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO refreshing stack...
2021-04-05T23:13:41.238Z 7b22ae10-1893-4c34-96b8-7b6b76aa9163 INFO Refreshing (3868a615-a53c-48ff-9099-..
gentle-diamond-70147
04/05/2021, 11:26 PMpulumi login
is not yet supported in the automation api - https://github.com/pulumi/pulumi/issues/5591. So what you're doing is the best option until it gets added.red-match-15116
04/06/2021, 3:44 AMPULUMI_BACKEND_URL
environment variable - but either way works!brave-angle-33257
04/06/2021, 3:52 AM