This message was deleted.
# dotnet
s
This message was deleted.
f
Any pointers on how to address fix this? Been hacking around and I'm just not seeing it...
t
It must be
Output<ImmutableDictionary<string, string>>
and you have to make some mind-bending output conversions to achieve this, I’m afraid
Copy code
var userPasswords = new List<Output<KeyValuePair<string, string>>>();
    foreach (var username in users)
    {
        //...
        userPasswords.Add(userLoginProfile.EncryptedPassword.Apply(p => new KeyValuePair<string, string>(username, p)));
    }

    UserPasswords = Output.All(userPasswords)
        .Apply(ps => ps.ToImmutableDictionary());
}

[Output("userPasswords")]
public Output<ImmutableDictionary<string, string>> UserPasswords { get; set; }
f
Thank you @tall-librarian-49374, that worked. I knew there was an
Apply
there somewhere but I just couldn't see how to connect the dots. It is a little mind bending and
Output.All()
is new to me. Before I posted this I did thoroughly check the docs and I cloned various repos to splunk code.... I might assert there is a gap in docs / samples around all this ( https://www.pulumi.com/docs/search/?q=Output.All 🤔 ).
t
I do understand this is hard… And yes, we should have more learning material around outputs.
👍 1