chilly-sunset-85353
12/31/2025, 3:06 PMvar map = new InputMap<string> {
{ "a", "1" },
{ "b", "2" },
{ "c", "3" },
{ "d", "4" },
};
map.Apply( m => m.Keys ).Apply( k => { Log.Warn( string.Join( ',', k )) ; return k; });
Running this multiple times will result in something like the following:
First run:
d,c,a,b
Second run:
b,d,a,cchilly-sunset-85353
12/31/2025, 3:07 PMchilly-sunset-85353
12/31/2025, 3:09 PMpulumi up.
I'm fine if it's non-deterministic and I need to sort it myself, but this just cropped up when I can't recall having issues with it before. I'm not sure if I've been lucky and dodged this issue until now or if it's some new behavior.chilly-sunset-85353
12/31/2025, 3:11 PM// it has the proper order here
return new Dictionary<string, object?> {
{ "testmap", map }
};chilly-sunset-85353
12/31/2025, 3:11 PMsilly-country-86708
12/31/2025, 3:51 PMchilly-sunset-85353
12/31/2025, 4:08 PMchilly-sunset-85353
12/31/2025, 4:08 PMchilly-sunset-85353
12/31/2025, 4:09 PMchilly-sunset-85353
12/31/2025, 4:09 PMchilly-sunset-85353
12/31/2025, 4:09 PMchilly-sunset-85353
12/31/2025, 4:10 PMchilly-sunset-85353
12/31/2025, 4:16 PMvar map = new Dictionary<string, string> {
{ "d", "4"},
{ "c", "3"},
{ "a", "1" },
{ "b", "2" },
};
var immutableMap = map.ToImmutableDictionary();
var inputMap = new InputMap<string> {
{ "d", "4"},
{ "c", "3"},
{ "a", "1" },
{ "b", "2" },
};
Output.JsonSerialize( Output.Create( map ), new JsonSerializerOptions { WriteIndented = true } ).Apply( a => { Log.Warn( "plain: " + a ); return a; } );
Output.JsonSerialize( Output.Create( immutableMap ), new JsonSerializerOptions { WriteIndented = true } ).Apply( a => { Log.Warn( "immutable: " + a ); return a; } );
Output.JsonSerialize( inputMap.ToOutput(), new JsonSerializerOptions { WriteIndented = true } ).Apply( a => { Log.Warn( "inputmap: " + a ); return a; } );
this results in the following output:
warning: plain: {
"d": "4",
"c": "3",
"a": "1",
"b": "2"
}
warning: immutable: {
"a": "1",
"c": "3",
"d": "4",
"b": "2"
}
warning: inputmap: {
"a": "1",
"c": "3",
"d": "4",
"b": "2"
}chilly-sunset-85353
12/31/2025, 4:16 PMchilly-sunset-85353
12/31/2025, 4:17 PMchilly-sunset-85353
12/31/2025, 4:26 PMchilly-sunset-85353
12/31/2025, 4:27 PM