How it works
Provisioning with Terraform is a hand-off between you and your customer:- You create the install. The install workflow pauses at the await install stack step.
- On that step, you copy or download the generated
inputs.auto.tfvarsandsecrets.auto.tfvars. - You send them to your customer.
- Your customer clones the install stack module and applies it in their cloud account.
- 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.
Provisioning the stack
Follow these steps to provision a stack using Terraform.Create an install
Create an install as you usually would, and wait for the provision workflow to get to the await install stack step.
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.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.
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.