Hi, right now we have all our clients based on Ter...
# general
b
Hi, right now we have all our clients based on Terraform and we have a lot of custom modules for all AWS resources (and more) created in Terraform by ourselves, so we can reproduce similar architectures so simply using Terraform + Terragrunt. Now we a looking for a way to migrate the logic of some of our modules to pulumi,for this purpose i'm investigating how to create our custom Python Packages for Pulumi so we can have something more generic that can be reused in multiple clients, there is any recommended way to make somethin like this?.
s
Plain old Python packages are one way to solve this problem. In addition, if your org is large and uses a multitude of languages, multi-language components might be a good fit for your problem: https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-language-components/
b
Yeah! i'm thinking in Python packages but i cant figure out a good practice to make it. Have you any example?
i want to use packages and still using the Pulumi.yaml to set the values. I dont know if the best way is using packages as clases like this (fast typed) example:
s
You want to use Pulumi.yaml to pass values to your Python packages? Why not just use regular code?
b
Yes i want to pass values with Pulumi.yaml, what do you mean with regular code??
@stocky-restaurant-98004
s
Well, if you want to pass a value to a Python module, you don't have to use Pulumi.yaml - you can use any way you like to grab the value.
b
Yes! i know that its a better practice, i'll work on it. Now i'm looking for use ComponentResource, is it a better aproach for this module oriented architecture?
s
I'm not totally sure I understand what you're asking, but I would recommend creating a class that encapsulates some major component of the infra you want to modularize. The values should be passed to the module directly via code if possible. I wouldn't recommend, e.g., a module taking a config value directly from an external YAML file.
🙏 1