Scalr
Scalr
June 8, 2023

Terraform No Code Provisioning made easy on Scalr

By
Ryan Fee

While Terraform provides a powerful and flexible way to manage infrastructure, it does require writing code in HCL. At Scalr, we recognize that not everyone in your organization will be able to getup to speed on Terraform as quickly as you may like. Your organization also may not have the need to have many Terraform experts as long as there is a core group of individuals who can write reusable modules. This is where the Scalr “no code” workspaces are extremely useful.

The Scalr no code workspaces give any user the ability to deploy a Scalr workspace and execute Terraform code without having to write any themselves. There are two main steps to using no code workspaces: Publishing modules and deploying the workspace.

Publishing Modules

The publishing of the modules is likely going to be handled by the team that is creating and managing the Terraform code. After the module has been created, it can be pushed to the Scalr module registry, which makes it available to be used in a workspace.

Screenshot of Module publication in Scalr

Module administrators have the choice of limiting which modules can be deployed through a no code workspace by adding a scalr-module.hcl to the repository

Example: All modules in the modules/ directory are included, except for the system module.

version="v2"
root-modules = ["modules/**", "!modules/system"]

See more examples here.

Deploying the Modules

Consuming the published modules is very simple. As an end user, you simply have to go to the module registry within your environment, click on the module you want to deploy, and then select create workspace. Upon creating the workspace, you will be presented settings for the workspace, but the actual module and version will be pre-populated for you:

Screenshot of Workspace creation

Once the workspace is created, Scalr will review the configuration file and if there are any required variables that have not been set, you will be prompted to fill in a value:

Screenshot of Prompt to add variables

Once the values are added, you can then execute the run, which will deploy your resources through Terraform. 

It’s as simple as that! With just a few clicks, we were able to deploy a Terraform workspace and run without having to write any code.

Upgrading Module Versions

It's a certainty that after you make your initial deployment that there will be changes to the module your workspace was deployed from. Instead of tearing down the workspace and rebuilding it, Scalr makes it easy to upgrade the module in the workspace by going to the settings and selecting the version:

Screenshot of updating the module in Scalr.

Just create a new run in the same workspace and your infrastructure will now use the new version of the module.

Advantages to No Code Workspaces

  • Quickly Standardize - It may be impractical to bring every individual up to speed with writing Terraform code, yet your organization wants to establish Terraform as a standard. No code workspaces allow you to adopt and standardize on Terraform, while the team gets up to speed.
  • Improve Security - By publishing modules to consume, you know that your users are following the best practices and not creating potential vulnerabilities in their own code.
  • Not a Service Catalog - Sometimes users are resistant to change and organizations resort to a service catalog to push a new standard. Service catalogs usually don’t help a cultural change, it’s just a way to hide what’s going on in the background. The no-code workspace allows users to have the self-service feeling while still understanding the basics of Terraform.

Other features to use in conjunction get the most value:

  • Reporting - Use Scalr reporting to understand which modules are the most popular and which modules are not used or out of date. Get all workspaces on the latest version by viewing reports.
  • Open Policy Agent - Use OPA to check if users are violating any security controls.
  • RBAC - Control who can manage modules, who can create Terraform plans, or who can approve and apply.

All of the features we talked about as part of the no-code provisioning are available on all plans, including the free plan. Sign up and try it out! Want to see it in action? Check out our video of it in action.

Note: While this blog references Terraform, everything mentioned in here also applies to OpenTofu. New to OpenTofu? It is a fork of Terraform 1.5.7 as a result of the license change from MPL to BUSL by HashiCorp. OpenTofu is an open-source alternative to Terraform that is governed by the Linux Foundation. All features available in Terraform 1.5.7 or earlier are also available in OpenTofu. Find out the history of OpenTofu here.

Start using the Terraform platform of the future.

A screenshot of the modules page in the Scalr Platform