We have a long standing issue for this:
https://github.com/pulumi/pulumi/issues/423
Fixing it looks like it would require writing our own yaml serialiser/deserialiser that maintains trivia. yaml is a huge spec to get right, and trivia is well known to be hard to get right so this is
very unlikely to actually happen 😞