Skip to main content
Nuon supports provisioning install stacks using Terraform. We maintain a collection of open-source terraform modules that can be used directly, or forked and customized.

How it works

Provisioning with Terraform is a hand-off between you and your customer:
  1. You create the install. The install workflow pauses at the await install stack step.
  2. On that step, you copy or download the generated inputs.auto.tfvars and secrets.auto.tfvars.
  3. You send them to your customer.
  4. Your customer clones the install stack module and applies it in their cloud account.
  5. The stack boots up the runner. Once the runner connects, the await install stack step completes.

Prerequisites

Your customer will need the following in order to apply the stack.
  • The Terraform CLI installed, or set up in their chosen automation platform.
  • Credentials for the target cloud account, so Terraform can provision resources.
  • Outbound network access to the Terraform Registry (to install the nuonco/stack provider) and to the Nuon API (so the provider can fetch the stack configuration at apply time).

Provisioning the stack

Follow these steps to provision a stack using Terraform.
1

Create an install

Create an install as you usually would, and wait for the provision workflow to get to the await install stack step.
2

Send your customer the files

On the await install stack step, copy or download inputs.auto.tfvars and secrets.auto.tfvars, then send them to your customer.The remaining steps are for your customer.
3

Clone the install stack module

Clone the repo and enter the directory for your cloud (aws or gcp):
4

Configure remote state (recommended)

If you have not already, set up a state store and configure it as a remote backend. See the Terraform backend docs for details.If you do not have a dedicated terraform state store, you can store the state in the cloud account alongside the stack.
5

Configure the install

The inputs.auto.tfvars file can be stored in version control alongside the terraform module. It can also be stored in the environment configuration of your chosen automation platform.secrets.auto.tfvars should be stored separately as a secret value. Alternatively, the secret values can be saved in a secret store and passed to terraform as environment variables.
6

Provision the stack

Initialize the terraform workspace and apply.
This will provision the Nuon stack. Once the runner phones home, the await install stack step in Nuon will complete.