Multiple environments in a single render.yaml file
complete
Š
Štefan Ľupták
It would be super useful to be able to do something like this in the 
render.yaml
 file:environments:
  - name: my-project-prod
    previewsEnabled: false
    services:
      # ...
    envVarGroups:
      # ...
    databases:
      # ...
  - name: my-project-staging
    previewsEnabled: true
    services:
      # ...
    envVarGroups:
      # ...
    databases:
      # ...
It's basically "just" nesting the current content of the 
render.yaml
 file into the environments
 array. This would enable workflow such as having prod
 without preview environments and then having staging
 with preview environments. Workflow like that is currently impossible to achieve when I want to use infrastructure as a code.Log In
j
james
Brian Dumbleton Thanks for this - is it possible to use this new feature to have preview generation only enabled for one environment (e.g. staging) ? That would be perfect!
B
Brian Dumbleton
Hey james! This launch doesn't include support for configuring 
preview.generation
 per environment, but our team is tracking that as an  improvement we want to ship for Blueprints. This launch primarily brings them up to parity with what you could already do in the dashboard, and gives more options for organizing a Blueprint to better represent the structure of your infrastructure on Render.I noticed there wasn't already a public feature request for this so I've gone ahead and created one: https://feedback.render.com/features/p/configure-preview-generation-per-environment
Please feel free to upvote and/or comment with more details! We're actively collecting feedback for this part of the platform right now 😄
B
Brian Dumbleton
marked this post as
complete
Render Blueprints now allow you to define which Projects and Environments a service in your workspace belongs to in a single render.yaml. 
You can read more about how it works here: https://render.com/changelog/blueprints-now-support-projects-and-environments
Blueprints also support a new ‘ungrouped’ field that allows you to define services that do not belong to any project or environment.
O
Omar Allaoui
Fully agree
k
kolanos
I may be underestimating the complexity here. But I assume Render has "render.yaml" hardcoded somewhere. If we could set our own value for the render.yaml file I think that addresses most of the use cases here. For example when adding a blueprint via the Render console, there could be a field to change the default "render.yaml" value. Then Render just looks for that blueprint file instead of the default "render.yaml" when loading the blueprint. Would also want to do this by environment, so one would add a blueprint for each environment, specifying the blueprint file for each one, or just leaving the default value ("render.yaml") if the user doesn't need an override. This in my mind is the cleanest approach and doesn't require Render to make significant structural changes to the blueprint spec.
But this and related feature requests have been hanging around for years, so it is entirely possible I'm missing something here. Hope we see something like this soon as I think it will simplify a lot of Render setups.
j
james
Yes this would also be incredibly useful for us, either a single file or multiple files, one for each environment, combined with https://feedback.render.com/features/p/disable-individual-services-in-preview-environments
B
Bergur Hallgrimsson
This along with service grouping (https://feedback.render.com/features/p/service-grouping) would be ideal.
Imagine grouping your resources (api, database, redis, static) into a custom group and then defining a blueprint for that e.g.
render.production.yaml
render.staging.yaml
C
Chunlea
Instead of combining all things in a single file, I prefer we have dedicated overwrite yaml file like docker-compose, we can have 
render.yaml
 as the basic file for default envs, and have render.staging.yaml
 or render.production.yaml
 to overwrite the old value from the render.yaml
 file. One pain I found is that currently the render only support 
render.yaml
 file, which make me to set up different envs too hard for different team accounts.A
Aldric Giacomoni
Our team would also really like this to be possible.
