Hi Everyone. I am using pulumi and azure python sd...
# general
b
Hi Everyone. I am using pulumi and azure python sdk. I want to spread the resources creation across several python files, so I have:
Copy code
__main__.py
azure-appservice.py
But it seems my code is only executed when it is in
__main__.py
and the resources defined on
azure-appservice.py
are not readed when I execute
pulumi up
command. Is there a way to use more than one python file similar to terraform?
b
you can't have it read all the files, but you can import from other files, and separate the resources into components. See here: https://github.com/jaxxstorm/pulumi-nginx-demo/blob/main/nginx-ingress/app.py and here: https://github.com/jaxxstorm/pulumi-nginx-demo/blob/main/nginx-ingress/__main__.py#L45
the way terraform works sorta violates the "principal of least surprise" to me, executing random files you haven't explicitly imported
💡 1
b
@billowy-army-68599 thanks, it makes sense under modularity perspective.