@causa/workspace-terraform
v0.6.0
Published
The Causa workspace module providing functionalities for infrastructure projects coded in Terraform.
Downloads
15
Readme
@causa/workspace-terraform
module
This repository contains the source code for the @causa/workspace-terraform
Causa module. It provides Causa features and implementations of cs
commands for Terraform infrastructure projects. For more information about the Causa CLI cs
, checkout its repository.
➕ Requirements
The Causa Terraform module requires Terraform to be installed.
🎉 Installation
Add @causa/workspace-terraform
to your Causa configuration in causa.modules
.
🔧 Configuration
For all the configuration in your Causa files related to Terraform, look at the schema for the TerraformConfiguration
.
✨ Supported project types and commands
This module supports Causa projects with project.type
set to infrastructure
and project.language
set to terraform
.
Infrastructure commands
cs infrastructure prepare
: Runsterraform plan
.cs infrastructure deploy
: Runsterraform apply
using a previously computed plan.
The dictionary defined in the infrastructure.variables
configuration can be used to pass input Terraform variables. This dictionary is rendered before being used, meaning it can contain formatting templates referencing other configuration values and secrets.
The terraform.workspace
configuration determines the Terraform workspace set prior to running any operation. Combined with Causa environments, this can be a powerful feature to manage the infrastructure of several deployment environments.
Project commands
The Terraform module also supports some of the project-level commands, namely:
cs init
: Runsterraform init
.cs lint
: Runsterraform fmt
. The format operation is run with the-check
argument, such that it only lints the code without fixing it. This operation supports theproject.externalFiles
configuration, by linting all Terraform files matching the glob patterns.cs dependencies update
: Runsterraform init
with the-upgrade
option, allowing the update of dependencies and the lock file.