fresh-summer-65887
10/14/2020, 8:14 PMOutputstring
as a stack output and failing hard 😞. The error I get with this is:
System.InvalidOperationException: [Output] Global.GlobalStack.UserPasswords contains invalid type Pulumi.Output`1[[System.String, System.Private.CoreLib, Version=4.0.0.0
, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]:
The only generic types allowed are ImmutableArray... and ImmutableDictionarystring, ...`.
at Pulumi.Serialization.Converter.CheckTargetType(String context, Type targetType, HashSet`1 seenTypes)
at Pulumi.Serialization.Converter.CheckTargetType(String context, Type targetType, HashSet`1 seenTypes)
at Pulumi.Serialization.OutputCompletionSource.InitializeOutputs(Resource resource)
at Pulumi.Deployment.Pulumi.IDeploymentInternal.ReadOrRegisterResource(Resource resource, ResourceArgs args, ResourceOptions options)
at Pulumi.Resource..ctor(String type, String name, Boolean custom, ResourceArgs args, ResourceOptions options)
at Pulumi.ComponentResource..ctor(String type, String name, ComponentResourceOptions options)
at Pulumi.Stack..ctor(StackOptions options)
at Global.GlobalStack..ctor() in C:\dev\logicality\cloud-infra\aws\global\Global\GlobalStack.cs:line 13
tall-librarian-49374
10/14/2020, 9:42 PMOutput<ImmutableDictionary<string, string>>
and you have to make some mind-bending output conversions to achieve this, I’m afraidvar 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; }
fresh-summer-65887
10/15/2020, 6:32 AMApply
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 🤔 ).tall-librarian-49374
10/15/2020, 6:53 AM