Thoughts and questions re dotnet automation api an...
# dotnet
w
Thoughts and questions re dotnet automation api and configuration... • given I have my own generic host with config, logging, and services (di) etc • automation api for config can effectively be bypassed with config injected directly into stack instance • ... is this safe or will there be some gotchas that I might be missing? • ... I guess still needs to be called if only to record config values used at the time that will then show in the ui? • provider use of config is currently problematic (https://github.com/pulumi/pulumi/issues/5582) • ... could this be lazy initialized or invert control by calling back to the automation host for config? • ... but is this not a problem if you always explicitly instantiate a provider and pass args?
b
I created a ProviderHelper so I can switched between aws accounts with using statements. https://gist.github.com/dbeattie71/2f5824aa9884b233ad10f098eb3b49a5
👍 1
And some reflection to get access to _transformations. That might not be needed with automation-api now.
w
So it definitely looks like the provider config can be bypassed / overridden via provider args, which avoids the provider static config issue.
I'm still wondering if Pulumi config matters... if I inject an
IOptions<T>
config into a stack instance I don't need to roundtrip config through the Pulumi config api, unless I'm missing something.
👍 1
Presumably Pulumi up runs without any config if config already manifests in stack resource declarations - by being passed to the ctor and used from there.
I'll try to put an example repo on GitHub that I can point to rather than waving my hands
b
You can DI right into the stack
Not using all those config options, trying several things out.
w
Yep, I'm doing something similar. I'm just unsure about using Pulumi config when dotnet config sources are so powerful and I want to just use them.
👍 1
b
The helper I created relies on Stack, I'm wondering if there is a way to accomplish the same, with only using a LocalWorkspace and an InlineProgram.
@worried-city-86458 This might be an example of the config question you were asking, https://github.com/UbiquitousAS/autodevops/blob/94febfa61fcb4c9156e9198be5149ac16a6b5a8e/Ubiquitous.AutoDevOps/Extensions.cs