Any pointers on how to address fix this? Been hacking around and I'm just not seeing it...
t
tall-librarian-49374
10/14/2020, 9:42 PM
It must be
Output<ImmutableDictionary<string, string>>
and you have to make some mind-bending output conversions to achieve this, I’m afraid
tall-librarian-49374
10/14/2020, 9:51 PM
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
fresh-summer-65887
10/15/2020, 6:32 AM
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
tall-librarian-49374
10/15/2020, 6:53 AM
I do understand this is hard… And yes, we should have more learning material around outputs.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.