Configure Terraform Backend Repository with Artifactory Using Terraform Client

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

To configure your Terraform client to work against Artifactory as a remote state storage and locking provider:

  1. Authenticate your client using the following command:

    Note

    Make sure to replace the placeholder with your JFrog Platform domain.

    terraform login <YOUR_JFROG_DOMAIN>
  2. 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-"
            }
        }
    }