https://pulumi.com logo
#dotnet
Title
b

bright-hydrogen-2039

09/14/2023, 2:51 AM
He folks, I am new to Pulumi and am having trouble with some configuration management. I am trying to read config vaules from the stack yaml file (some of which are secrets) and inject them into a IConfigurationSource implementation to allow for IOptions support. The issue I am facing is I am unable to access the actual string values of the Output returned from the
config.RequireSecret()
calls. I saw mention in the docs and a reply to another thread to use the
.Apply()
method to unwrap the values but the return values from all options for the
Apply()
method return `Output`s. I am using the latest versions available from NuGet: • Pulumi v3.56.2 • Pulumi.AzureNative v2.6.0 Does anyone have advice on how to solve this issue?
b

billowy-army-68599

09/14/2023, 3:19 AM
You cannot get a standard string from an output. You need to do it inside the Apply
b

bright-hydrogen-2039

09/14/2023, 3:24 AM
Thanks @billowy-army-68599, appreciate your time
b

billowy-army-68599

09/14/2023, 3:25 AM
If you share some code we can likely get it working
b

bright-hydrogen-2039

09/14/2023, 3:26 AM
I think I was over thinking it tbh, have been refactoring a bunch of code and have stumbled upon a solution. Weird how new stuff can trip you up on seemingly simple things 😄
b

bored-activity-40468

09/14/2023, 3:19 PM
@bright-hydrogen-2039 if you haven't already seen this example, it has some neat stuff https://github.com/gitfool/Pulumi.Dungeon
f

fast-vr-6049

09/14/2023, 6:02 PM
I've never seen Pulumi Dungeon before! The readme is rather thin; what's the repo's purpose?
b

bored-activity-40468

09/14/2023, 11:56 PM
I believe the creator uses it at his place of employment but made it OS which is nice. It's a great example of Pulumi/C#/automation-api. It uses multiple providers, AWS and the k8 provider. Config happens via yaml files which he made inheritable, kind of neat. But config could happen from any provider. The end result is it standing up an EKS cluster and then uses the K8 provider to further configure it. But the overall example could be used to provision anything.
It also uses Scriban to for config/policy templating.