Usage Guide
In addition to the Tharsis CLI, the Terraform CLI can be used with Tharsis as well.
The Tharsis CLI also supports running Terraform commands directly via the tf-exec subcommand, without needing to configure a remote backend. See the tf-exec command reference for details.
Please refer to the Terraform CLI documentation for the latest information.
Login​
terraform login api.tharsis.example.com
Configure the provider​
The Terraform backend must be configured so it can communicate with Tharsis.
terraform {
backend "remote" {
hostname = "api.tharsis.example.com" # API Endpoint
organization = "top-level.bottom-level" # Existing group's path with '/' as '.'
workspaces {
name = "demo" # Workspace name
}
}
}
Replace
hostname,organization, andworkspace.namewith appropriate values. Please refer to the code comments.
Initialize the backend​
Once the Terraform module has been completed, initialize the module and then optionally validate it.
cd <directory containing module>
terraform init # Creates the workspace at the specified group.
terraform validate # Optional, although recommended.
If the backend configuration changes, running terraform init -reconfigure might be necessary.
Create a speculative plan​
terraform plan
If the configuration was correct, Terraform should display job logs and exit with a message Uploaded plan output to object store.
Before deploying to AWS or Azure, a managed identity must be created. Learn more.