Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple files for Yaml resources #227

Open
BoSoeborgPetersen opened this issue May 21, 2022 · 6 comments
Open

Multiple files for Yaml resources #227

BoSoeborgPetersen opened this issue May 21, 2022 · 6 comments
Labels
area/expr Syntax, expressions, and functions in YAML impact/first-48 This bug is likely to be hit during a user's first 48 hours of product evaluation kind/enhancement Improvements or new features language/yaml

Comments

@BoSoeborgPetersen
Copy link

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I would like to avoid files getting too long, so I would like to split my resources over multiple files, either by using some kind of import statement in the main file, that points to other files like:

Pulumi.yaml:

name: github-actions-runners-cluster
runtime: yaml
description: GitHub Actions Runners Cluster

resources:
  resourceFile: container.yaml
  resourceGroup:
    type: azure-native:resources:ResourceGroup

Container.yaml

resources:
  registry:
    type: azure-native:containerregistry:Registry
  workspace:
    type: azure-native:operationalinsights:Workspace
  managedCluster:
    type: azure-native:containerservice:ManagedCluster

Or implicitly by including everything from all files in a folder called "resources", in addition to the main yaml file.
Or both?

Affected area/feature

@BoSoeborgPetersen BoSoeborgPetersen added the kind/enhancement Improvements or new features label May 21, 2022
@AaronFriel AaronFriel added area/expr Syntax, expressions, and functions in YAML language/yaml labels May 21, 2022
@terekete
Copy link

terekete commented Sep 8, 2022

Is it possible to do this today ?

@nstires-ctgx
Copy link

Is it possible to do this today ?

Doesn't appear so per https://pulumi-community.slack.com/archives/C03E69EQRD2/p1664981326357059

+1 to feature request.

@desteves desteves added the impact/first-48 This bug is likely to be hit during a user's first 48 hours of product evaluation label Sep 18, 2023
@desteves
Copy link

+1

@EronWright

@jamest-pin
Copy link

I would really like this. My Pulumi.yaml file is enormous and unwieldy

@AaronFriel
Copy link
Contributor

@terekete @nstires-ctgx @desteves @jamest-pin et al., I regret that I wrote something for this in the community Slack and neglected to update this issue. Using the compiler runtime option, a script can be used to merge multiple YAML files. See this repository for an example.

https://github.com/AaronFriel/pulumi-yaml-multi-file

I'm quite partial to this style myself, as I can put the relevant configuration alongside each resource. It's definitely a "Better Helm template", in my opinion. Hopefully this workaround helps manage the complexity of your YAML configurations.

At the same time, please continue to upvote this issue though if an "in-box" solution is important to you!

@jamest-pin
Copy link

@AaronFriel very cool. At first glance looks like it will do what I need.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/expr Syntax, expressions, and functions in YAML impact/first-48 This bug is likely to be hit during a user's first 48 hours of product evaluation kind/enhancement Improvements or new features language/yaml
Projects
None yet
Development

No branches or pull requests

6 participants