This message was deleted.
# getting-started
s
This message was deleted.
d
Context: The terraform provider (and pulumi registry item) for MongoDB don't include the Atlas DataAPI application service and dependents, so I'm building that as a set of dynamic resources. Code, Config, and Logs: https://gist.github.com/jakobo/bda66c77da6f9bfd4c0cdd50392f9ce4
g
There is a known issue with accessing
pulumi.Config
inside dynamic providers. https://github.com/pulumi/pulumi/issues/4512
My suggestion (same as issue comments) is to pass those needed values as args.
Not saying that's your only issue, but likely one of them.
d
I can definitely work around that one. Was following a pulumi video. Makes sense that wouldn't serialize well. Will report back. The current pulumi error is below which I'm just stumped on. (edit: code config and logs moved to <https://gist.github.com/jakobo/bda66c77da6f9bfd4c0cdd50392f9ce4>)
Code and error updated to reflect current status. No change in the output. It's definitely at the library level, but if I can't use node-fetch, axios, got, ky, and others I feel rather stuck. Purrl gets around this by making the http calls in Go, but it's very difficult to marshal the bearer token (via
response.apply
through all the resources)
g
šŸ˜• it's an odd error message. I can't take a look at the code further right now, but there should be no issue using
axios
or whatever HTTP client you want with a dynamic provider. Thats the whole point!
d
That's what I thought too šŸ˜† I suppose the following questions come to mind that might unblock me • What runtime is the serializer using at execution? My pulumi code is all ts with ES2020+node16 module resolution. It might be getting serialized for node16, and then executing in a different runtime • Is pulumi's ts-node config somewhere? Searching the repo turned up a lot of hits. I'm running
esm: true
& coupled with the compile targets I might be messing up the internal serialization
b
I would recommend opening a GitHub issue for things in the engine like this if you can summarise it
d
I'll try. sweaty blob I'm still trying to wrap my own head around what I'm seeing. I will clean up this thread and move everything into a gist so it's easier to read. I've just got massive gaps in my understanding of how serializing works and why node 18/esm would cause it to fail out before even reaching preview.
Traced it to the following GitHub issue, about 1.5 years old. https://github.com/pulumi/pulumi/issues/5294 They're likely to be the same root cause, as dynamic resources make use of the same serialization. It's just really easy to trip on native code. šŸ˜ž