https://pulumi.com logo
Title
g

gifted-cat-49297

04/19/2023, 7:27 AM
Hello, is there a way to have multiple yaml files for single stack? We'd like to split services by files to not have 1000 lines
b

bright-orange-69401

04/19/2023, 8:22 AM
AFAIK no, which is one of the reasons why we moved away from YAML and use Python YAML is elegant in that it’s fast and language-agnostic... but it’s definitely not made for larger projects IMO
g

gifted-cat-49297

04/19/2023, 8:31 AM
I think I'll try microstacks approach so it will limit amount of configuration in single yaml file. But it would be great to have an option to use multiple yaml files
b

bright-orange-69401

04/19/2023, 8:32 AM
If you go for many stacks, then you’ll have to run many “pulumi up”... unless you intend to use Pulumi Automation to script that and run them sequentially somehow ?
g

gifted-cat-49297

04/19/2023, 9:22 AM
Multiple gitlab-ci.yml files, one per folder which handle pulumi up for single service.
q

quaint-hydrogen-7228

04/19/2023, 10:27 AM
For YAML there is the option to run a command that produces the YAML file, which for example could be used with other tools such as CUE to combine multiple files into a single YAML.
g

gifted-cat-49297

04/20/2023, 9:22 AM
Hm, when using "mono" stack I had stack per env in project. But going with microstack I need to use tags
env:dev
But how to handle configuration file with that approach. I had Pulumi.dev.yaml and Pulumi was just getting config from this file when given stack was selected.
Ah nevermind, Pulumi is grouping them by Gitlab repo, neat
b

bright-orange-69401

04/20/2023, 9:41 AM
Cool article @limited-rainbow-51650 I laughed when I saw good ol' Fortran in there 😆 Basically, the
compiler
parameter allows you to pre-compile your YAML with any language (I would use Python instead of Fortran... but eh) Doesn't that kinda defeat the purpose of using YAML in the first place ? Maybe that makes sense to do it if all the compiler does is regroup a bunch of files into one big YAML, idk