https://pulumi.com logo
Title
f

fast-belgium-1399

05/20/2023, 2:36 AM
I'm trying to create a new collection from a property of type Output<ImmutableDictionary<string, string>?> to set a property of type InputMap<string> but can not get it to work. The preview keeps saying it is going to remove tags: {SomeKey: "SomeValue"} and replace it with tags: output<string>.
var tags = ResourceGroup.Tags.Apply(rgTags =>
            {
                var tags = new Dictionary<string, string> { { "SomeKey", "SomeValue" } };
                if (rgTags == null)
                {
                    return tags;
                }

                // Other logic to mainpulate tags goes here

                return tags;
            });

new PrivateEndpoint("name", new PuluimiResourceArgs{ Tags = tags}};
b

bored-activity-40468

05/20/2023, 7:30 PM
Try returning a Dictionary<string,object>.
f

fast-belgium-1399

05/31/2023, 8:44 PM
Unfortunately that did not work. A type of Output<Dictionary<string,object>> can not be assigned to InputMap<string> (Compilation error). I even tried creating a Dictionary<string,object> outside of the apply and it doesn't work either.