To configure your OpenTofu CLI to work against Artifactory as a remote state storage and locking provider:
Authenticate your client using the following command:
Note
Make sure to replace the placeholder with your JFrog Platform domain.
tofu login <YOUR_JFROG_DOMAIN>
To configure the Terraform CLI to work with Artifactory, add the following information to your HCL file (
main.tf
):Note
Make sure to replace the placeholders with your JFrog Platform domain, the Terraform repository, and the prefix you would like to use.
terraform { backend "remote" { hostname = "<YOUR_JFROG_DOMAIN>" organization = "<REPOSITORY_KEY>" workspaces { prefix = "<PREFIX>" } } }
For example:
terraform { backend "remote" { hostname = "johnf.jfrog.io" organization = "tb-local" workspaces { prefix = "jfrog-" } } }