https://pulumi.com logo
Title
f

future-library-15294

04/20/2023, 6:23 PM
Greetings. I am attempting to abstract the classes in my Pulumi aws-python project's main.py file. Is it possible to split the classes using folders such as networks (for VPCs and subnets), buckets (for s3) and ECS? Still new to the whole process but want to avoid overloading one file with all the code.
s

salmon-account-74572

04/20/2023, 6:37 PM
You can definitely split the code into different files and then
import
them in your
__main__.py
file. This example in our Examples repository does exactly that: https://github.com/pulumi/examples/tree/master/aws-py-hub-and-spoke-network
f

future-library-15294

04/28/2023, 10:01 AM
Thank you. This really came in handy.
s

salmon-account-74572

04/28/2023, 2:16 PM
Happy to help!