https://pulumi.com logo
Title
k

kind-jelly-61624

01/26/2023, 8:42 PM
Hey folks, I had a question about creating Functions. I want to call a pulumi_aws function within my function (making it an invoke run by a function that was invoked) but it seems like the function loses all context to the pulumi engine. I get the error
AttributeError: 'NoneType' object has no attribute 'Invoke'
Not sure if this is how it’s intended to run or if it’s a bug. I’m using python. so my main.py has this:
instance_type = my_component.ec2.get_instance_size("small")
and the get_instance_size function has this:
a = aws.ec2.get_ami(...)
which fails with the NoneType error
g

green-stone-37839

01/28/2023, 12:11 AM
Hi @kind-jelly-61624 did you experience this error during a
pulumi up/pre
or something else like a unit test?
I have seen this type of error come up during unit tests, where the
pulumi.runtime
object resolved to
None
k

kind-jelly-61624

01/30/2023, 5:40 PM
Hello! I was only doing a pulumi preview / up not using any unit tests
g

green-stone-37839

01/30/2023, 5:41 PM
Does this behavior consistently reproduce itself? This seems like it could come down to some
venv
issue. I can't see any other reason the
pulumi.runtime
object would be
None
.