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

gifted-salesmen-8201

11/16/2021, 9:12 PM
Hi folks, how do you structure a large pulumi project in go, for example creating s3 buckets, policies and users..? Do you place all our code in a main.go file, or structure it in a pkg directory? Thanks in advance for your advice
l

little-cartoon-10569

11/16/2021, 9:13 PM
ComponentResources are the way to go. Essentially, OO for resources. https://www.pulumi.com/docs/intro/concepts/resources/#components
That way you can put your components in your normal source tree, and your main.go stays small and tidy. Just read config, construct a few providers, and pass them all to a few component resources.
🙌 1
g

gifted-salesmen-8201

11/16/2021, 9:14 PM
Great help, thanks alot! 🙂
👍 1
2 Views