Hi, whats the best way to set an s3 backend when u...
# dotnet
o
Hi, whats the best way to set an s3 backend when using the c# pulumi automation API. Ex.:
Copy code
var program = PulumiFn.Create<MyStack>();

var stackArgs = new InlineProgramArgs("test", "a", program);

var stack = await LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
await stack.SetConfigAsync("aws:region", new ConfigValue("eu-central-1"));
await stack.UpAsync();
e
I don't think there's anything in automation api to change backends. The main approach is to just make sure the ambient login is correct, but I think you can set the Pulumi.yaml for inline programs explicitly and set the backend there (see the ProjectSettings.Backend option)
o
Thanks for the info. I'd like to use the s3 backend but am still confused how authentication would be handled when using the Pulumi.yml file?
I think you can set the Pulumi.yaml for inline programs explicitly
do you maybe have an example or docs how to do that?
e
ProjectSettings is the class with the backend property to set. You then set the workspace settings with the new project settings. And the workspace settings are what you pass to things like
CreateStackAsync
authentication would be handled
Auth is always done using ambient environment variables for the s3 backend.
o
thats exactly what I was looking for! Thanks!