If you have a file like kafka/kafka.py with component resources, do you need an
__init__.py
file in the kafka folder? I would think importing component resources and functions would be the same, otherwise.
That said, use component resources they are neat.
d
dry-keyboard-94795
10/17/2023, 7:45 PM
Yes, you can split up resource creation into functions. Your example should work as written with the separate files
dry-keyboard-94795
10/17/2023, 7:47 PM
I think it should work without the init file, but it can be added as a blank file if you get import errors
b
billowy-army-68599
10/17/2023, 7:50 PM
I would really not recommend using functions, it’s a road to complex nesting and pain.
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.