Private Registries
In addition to using local modules, Tharsis also supports deploying them from a third-party Terraform registry. It supports any registry that adheres to the Terraform Module Registry Protocol.
Using the Tharsis CLI​
The CLI includes some built-in flags which make deploying remote Terraform modules possible. The same is possible with the destroy command.
Apply command​
tharsis apply \
--env-var "TF_TOKEN_<example_com>=<access_token>" \
--module-source https://example.com/some-module \
--module-version "2.3.2" \
--auto-approve \
top-level/mid-level/hero
Expand for explanation
-
--tf-var
and--env-var
: quickly allow creating simplekey=value
Terraform and environment variable pairs respectively. Use--tf-var-file
or--env-var-file
for variable files which also support HCL Terraform variables. Optional. -
--module-source
: URI to the module. Required for module source, optional otherwise. -
--module-version
: module version, defaults to the latest. Optional. -
--auto-approve
: bypass the need to confirm changes to the Terraform configuration and automatically run the apply stage after planning is complete. Optional.
Tharsis expects the TF_TOKEN_<domain_name>=<access_token>
environment variable to authenticate with the private registry. Learn more.
If deploying to AWS or Azure, be sure to assign a managed identity to the target workspace!