Infrastructure as Code (IaC)
You can use your Render Dashboard to create and manage services, but if you have a lot of services or your services require a lot of options, it can be helpful to define your Render infrastructure (services, databases, and environment groups) as code in a render.yaml
file.
You can add this file to source control to track changes to your infrastructure over time. Render also automatically updates your infrastructure when you push changes to render.yaml
, so your Render resources always remain in sync with the values defined in your code.
Getting Started
-
Create a Blueprint Spec (a file called
render.yaml
) at the root of your repo. You can start with our sample Blueprint and modify it to match your services. -
Click Blueprints in the navigation sidebar in the dashboard.
-
Click the New Blueprint Instance button.
-
Select the repo and branch containing your
render.yaml
file. -
Once selected, you’ll see a list of the changes that will be applied based on the contents of
render.yaml
. If there’s an issue with the file you’ll see an error message. If everything looks good, click Apply to create the resources defined in your file.
You’re all set! Future updates to your render.yaml
will be synced automatically and we’ll notify you
if there are any issues with the syncs.
Creating Multiple Environments
The default behavior for render.yaml
is to update existing resources.
However, there are times when you might want to create entirely new instances of the services defined in your Blueprint spec.
This is why, when we find existing resources that match the values of your render.yaml
, we ask you to pick one of the following two options:
- Update existing resources and create any missing resources to sync your services with the Blueprint definition.
- Ignore existing resources and create new instances of all the services defined in your
render.yaml
.
If you decide to use existing resources, you will see a list of the changes needed to bring your services in sync with your render.yaml
.
Here’s an example of the list of actions displayed when you sync existing resources:
If you decide to ignore existing resources, new instances of all your resources will be created,
and Render will add an auto-generated suffix to the names of the new services to help you differentiate between them:
No Automatic Deletions
When you remove resources from render.yaml
, they are not deleted in Render. This
prevents accidental deletions (for example, if a commit is reverted to a version missing a resource).
You can always delete a resource from your dashboard. If you need to recreate the resource, simply add it back to render.yaml
and push the changes to your repo.
Adding Existing Resources
If you have existing resources on Render and would like to start managing them with render.yaml
, simply
add them to the file.
You do not need to delete an existing service before adding it to render.yaml
.
Modifying Resources Outside Blueprint
You can still update or delete resources from the dashboard, but if they’re managed by Blueprint, your changes will be overwritten by future syncs. Resources will never be deleted, but they may be updated to match the values in render.yaml
.
Turning Off Automatic Sync
If you need more control of when render.yaml
resources are created or updated, you can turn off automatic syncs on the Blueprint Settings tab. You can then trigger a manual sync by clicking on the Manual Sync button and apply the displayed changes.