Config Roots and Environments

Config Roots

In Resourcely, a Config Root is a directory containing one or more Terraform files. Most config roots are applyable - a directory where you would run terraform apply.

Not all Config Roots are applyable - some are modules. These directories contain reusable Terraform config that applyable Config Roots can invoke. Support for module config roots is coming soon.

Before creating a pull request, Resourcely allows users to select which config root the pull request will add Terraform to.

Administrators define Config Roots (and their Environments) via resourcely.yaml.

Environments

Terraform makes it easy to provision similar copies of infrastructure, one per Environment ("dev" and "prod", for example). Environments are also called "Stacks" or "Stages" in other products.

When creating a pull requestΒ in a Config Root that has Environments, users can click the ENV button to supply environment-specific values for most form fields. Resourcely uses Terraform variables to represent these values - see below for an example.

Not all form fields support environment-specific values - it depends on how they are used within the Blueprint.

Given a blueprint like this:

resource "azurerm_resource_group" "example" {
  name = {{ resource_group_name }}
}

Resourcely would produce Terraform like this:

// in file: main.tf
resource "azurerm_resource_group" "example" {
  name = var.rg_name
}

// in file: variables.tf
variable "rg_name" {
  type = "string"
}

// in file: dev.tfvars
rg_name = "dev-group"

// in file: prod.tfvars
rg_name = "prod-group"

Last updated