Usage Guide
In addition to the Tharsis CLI, the Terraform CLI can be used with Tharsis as well.
info
Please refer to the Terraform CLI documentation for the latest information.
Login​
Authenticate using the Tharsis API's hostname
terraform login api.tharsis.example.com
Configure the provider​
The Terraform backend must be configured so it can communicate with Tharsis.
Sample module.tf provider configuration
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.name
with 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.
info
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.
important
Before deploying to AWS or Azure, a managed identity must be created. Learn more.