I believe what you are running into here is the same issue tracked in https://github.com/pulumi/pulumi/issues/6175. Note that this actually works fine in Node.js, just the TypeScript types don't allow it - so you can just cast to
any
and it will work. But there is also an improvement at the TypeScript layer being pursued in https://github.com/pulumi/pulumi/pull/6323 which would make this work without any need for workarounds.
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.