Resourcely recently announced support for IBM Cloud’s Terraform provider. With it, anyone can create paved roads for IBM Cloud resources.
- Make it easier and faster for developers to deploy IBM Cloud infrastructure
- Expand and scale your infrastructure adoption
- Govern the resources that are being deployed
- Ensure your cloud platform is stable and secure
- Reduce cloud infrastructure costs and waste
In this demo, we’ll take this example from the IBM Cloud Terraform database resource and turn it into a flexible Blueprint with attached Guardrails. Developers can choose from Blueprints, fill out a guided form, which will then automatically generate Terraform and submit a PR on their behalf to create infrastructure.
You can follow along in this clickable demo, or skip ahead to the instructions below. The Resourcely docs are also a wealth of information for how to customize your own Blueprints.
Clickable Demo
Blueprint structure
First, we’ll at the Terraform code and turn each field that we want developers to be able to input into {{ variables }}
.
Variable tags and parameters
You can see above that this is generally structured as Terraform, but with {{ variable }}
tags and parameters (desc
, default
, required
, links_to
, etc.). Each {{ variable }}
tag will automatically take an input in the resulting form developers interact with.
{{ variable }}
tags include some automated quality-of-life features, including automatic suggestions for properties. Take the service
variable above. The form automatically surfaces the various services
available for the database
resource.
This allows our developers the flexibility to choose the type of database that they want to deploy.
desc
and default
will provide hints for developers, while required
allows us to make inputs optional. links_to gives us the ability to search for existing resources OR resources that are being created by the developer.
IBM Cloud databases are required to be associated with a resource_group
, so we add a resource_group_id
with a links_to
tag. This manifests as a dropdown with available groups:
This is especially helpful for security groups, VPCs, IAM, or anywhere that developers want to use an existing resource.
Variables and groups sections
You will also notice that IBM Databases utilize a group
object where we have no obvious tag parameters:
Group
is for setting database infrastructure sizing. We have utilized Resourcely’s variables
and groups
sections to better organize these inputs, and Guardrails to put limits around how much infrastructure can be used.
Note that these sections belong at the top of your Blueprints, and are totally optional.
Guardrails for limiting cost
We’ve written the following Guardrails to enforce the amounts we put in the descriptions:
This results in Guardrail locks when the developer is configuring their infrastructure. Let’s say they want 24 CPUs. They can request approval from the default
approver group by unlocking the Guardrail.
This gives developers feedback at configuration time, and also makes sure that any PR that is generated goes to the right approver.
Section tags
Finally, IBM Cloud databases have the ability to add multiple users or access rules. We use the {{# variable }}
{{/ variable }}
syntax to allow creation of multiple objects with the same structure. Here is an example from our Blueprint:
This results in a section tag like the below, where developers can create multiple db_users
:
Resulting form
After all of our Blueprint customization, the following form is made available to developers that want to deploy a database:
This form for deploying a database on IBM Cloud gives developers choices, obfuscates other non-critical properties, and governs the choices that developers are making.
Once they fill the PR form out, Terraform is generated and a PR automatically submitted to your change management!
Summary
We built a paved road for deploying databases, starting from a purpose-built example for MongoDB and finishing with a flexible form that supports all of the provider’s settings while giving developers guidance and sensible defaults.
Blueprints are a great alternative to Terraform modules for deploying databases, while Guardrails allow you to tightly govern database configuration.
Get started with Resourcely yourself today!