Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Search





Overview

Did you know?

Terraform is an infrastructure as code (IaC) tool that allows developers to build, change and version infrastructure safely and efficiently. Terraform is written in HCL language. Code in the Terraform language is stored in plain text files with the .tf file extension. For more information, see the Terraform Language.

From JFrog Artifactory 7.38.4, JFrog provides a fully fledged Terraform repository solution giving your full control of your deployment and resolve process of Terraform Modules, Providers, and Backend packages.

The Terraform Registry in the JFrog Platform offers the following benefits:

  • Secure and private local Terraform Modules registry
  • Secure and private local Terraform Providers registry
  • Proxy remote Terraform Module and Provider resources with caching to keep you independent of the network and the remote resource.
  • Virtual Terraform repositories that support a single URL through which to manage the resolution and deployment of all your Terraform Modules and Providers.

The Terraform Backend Repository in the JFrog Platform offers the following benefits:

  • A Remote State Storage Provider
  • Support for multiple Workspaces
  • Built-in Secure State Encryption storage
  • Comprehensive State snapshot history
  • State content viewer with advanced search abilities

Terraform CLI Version Support

Artifactory supports Terraform CLI version 1.0.0 and above.


Supported Terraform Repository Types

The JFrog Terraform repository solution supports a number of Terraform repository types and dedicated configurations, all customized to accommodate the Terraform environment specific settings and requirements.

The following table describes the Terraform repository implementation in the JFrog Platform.

Terraform Repository TypeTerraform TypeLocal RepositoryRemote RepositoryVirtual Repository

Module/ ProviderSelect from drop-down list in Basic tabNo differentiationNo differentiation

BackendDedicated repository typeN/AN/A

Recommended Terraform Repository Setup

It is recommended to set up your Terraform repositories according to the following Terraform repository structure in the JFrog Platform to fully benefit from the full-fledged Terraform solution:

  • Local Terraform Module Registry
  • Local Terraform Provider Registry
  • Remote Terraform Registry
  • Virtual Terraform Registry: Aggregates the Local Terraform Module and the Local Terraform Provider registry
  • Local Terraform Backend (BE) Repository.

Getting Started

  1. Create dedicated Module and Provider registries.
  2. Create a Terraform Backend Repository.
  3. Generate an Access Token between Artifactory and the Terraform CLI.

Generating an Access Token between Artifactory and the Terraform CLI

Perform this one time procedure to generate and Access Token between Artifactory and the Terraform CLI.

  1. Natively run the Terraform login to your Artifactory domain to generate an access token and save it in the Credentials file (~/.terraform.d/credentials.tfrc.json).
    When you run the login, the following page opens.

    The Terraform command line login process is displayed.
  2. You are routed to the JFrog Platform login page and the following page opens.
  3. Click Approve.
    The following message is displayed.

  4. Close the page and return to the command line to view the success message.

  5. Next, perform a one time edit to the ~/.terraformrc file to ensure that the CLI searches for the providers only in the Artifactory. For this purpose, we recommend only pointing to the Terraform Virtual repository. 
  • No labels
Copyright © 2022 JFrog Ltd.