Create Terraform/OpenTofu and Terraform Backend Repository

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

This topic describes how to create a Terraform Repository. This is required before uploading and installing Terraform packages. There are three primary types of repositories:

  • Local repositories: Where you store and share 1st and 2nd party packages with your organization

  • Remote repositories: Enable you to download from any remote location including external package registries or other Artifactory instances

  • Virtual repositories: Enable aggregating remote and local repositories enabling your organization to scale by providing a single URL that provides access to multiple repositories and types

For more information on JFrog repositories, see Repository Management Overview.

Prerequisite: You need Admin or Project Admin permissions to create a Terraform repository. If you don't have Admin permissions, the option will not be available.

To create a Terraform repository:

Terraform BE

There is a dedicated Repository type for Terraform BE. Supports only Local repositories. Remote and Virtual repositories are not supported

  1. In the Administration tab, click Repositories | Create a Repository

    art-rpm-package-create-repository-06-25.png
  2. Select the repository type you want to create, configure the required fields (described in the following list), then click Create Repository.

    • For Local Repositories, in the Repository Key field, type a meaningful name for the repository. For example, Terraform-local-repository-1.

      From the Terraform Registry Type list, select Module/Provider as appropriate:

      • Module: terraform-module-default is the default repository layout

      • Provider: terraform-provider-default is the default repository layout

      Terraform Providers: Origin Registry

      To use Terraform Providers as Origin Registry, you must associate a GPG public key while creating a local repository. This key is used by Terraform to verify the integrity of the provider packages.

      Prerequisite: Generate GPG Keys and Upload GPG KeysGenerate GPG KeysUpload GPG Keys

      For more information on local repositories and all their possible settings, see Local Repositories.

    • For Remote Repositories, additionally, verify the Repository URL and update if needed. For more information on Remote Repositories and all their possible settings, see Remote Repositories and Remote Terraform Repository.

    • For Virtual Repositories, additionally select one or more local or remote repository types to include in the virtual repository. For more information on virtual repositories and all their possible settings, see Virtual Repositories.

      Note

      The remote and the virtual repository settings are identical for both Providers and Modules.

  3. Click Create Repository. The repository is created, and the Repositories window is displayed.