Hi all, I am getting a strange error running below code:
Cannot convert undefined or null to object
If I do for example scope.apply(x => console.log(x)) before creating this role assignment, I am getting the right value, but the moment it goes to scope it is null or undefined. What could be the potential problem?
a Terraform method in this code? It looks like a Pulumi method. What type of object is
state
? Is it a StackReference? I'm not aware of any way for a StackReference output to fail to resolve itself during resource deployment, but that's not to say it's impossible.
getOutput()
is being called during the creation of your resource tree, but its
apply()
method isn't being called until the Pulumi engine starts doing its thing. In theory, if Outputs created by
state.getOutput()
get their concrete value via an object that goes out of scope before the Pulumi engine calls
apply()
, then you might see this message. I never have, though, so this is a complete guess.
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.