https://pulumi.com logo
#general
Title
# general
c

creamy-monkey-35142

03/05/2024, 2:40 AM
Hello guys, I’m currently trying to use Dynamic Resource Provider function and meeting error when running
pulumi up
Copy code
Previewing update (dynamic):
     Type                               Name                       Plan     Info
     pulumi:pulumi:Stack                pulum-dynamic           
     └─ pulumi-python:dynamic:Resource  Hello Name                          1 error

Diagnostics:
  pulumi-python:dynamic:Resource (Hello Name):
    error: Exception calling application: No module named 'utils'
with folder structure
Copy code
stacks
├── Pulumi.dynamic.yaml
├── Pulumi.yaml
├── __main__.py
utils
├── dynamic
│   ├── __init__.py
│   ├── dynamic.py
│   └── provider
│       ├── __init__.py
│       └── random_provider.py
within
__main__.py
Copy code
import sys
sys.path.append('../')
from utils.dynamic import *
Dynamic().main()
and
dynamic.py
Copy code
from .provider.random_provider import *

class Dynamic():

    def main(self):
        print(Random("Hello Name"))
and
random_provider.py
is getting from https://www.pulumi.com/docs/concepts/resources/dynamic-providers/#example-random
The problem is if I push random_provider.py within the same directory of stacks/_main_.py then it working well.
can someone help me troubleshot this problem ;(
@echoing-dinner-19531 do you have any idea or suggestion? 😄
e

echoing-dinner-19531

03/06/2024, 8:26 AM
I think your hitting https://github.com/pulumi/pulumi/issues/7453. Latest on there is trying to symlink the folder in so it looks like its in the main module.
2 Views