ARTIFACTORY: How to create a Smart Remote Repository using Terraform as an IAC in JFrog Artifactory

ARTIFACTORY: How to create a Smart Remote Repository using Terraform as an IAC in JFrog Artifactory

AuthorFullName__c
Elumalai Ganesan
articleNumber
000005887
ft:sourceType
Salesforce
FirstPublishedDate
2023-10-12T15:52:32Z
lastModifiedDate
2023-10-12
VersionNumber
1

A Smart Remote repository in Artifactory is a Remote repository that proxies a Local, Remote, and Federated repository from another Artifactory Instance. Please find this documentation for more information on Smart Remote Repositories.

By using Terraform as IAC to create a smart remote repository in JFrog Artifactory.
Please find the official Terraform registry for JFrog Artifactory here and for Remote Repositories here.

However, we need to make sure that we added the below mentioned properties in the resource block along with other mandatory arguments for all package types.

 content_synchronisation {
    enabled                            = true
    properties_enabled                 = true
    source_origin_absence_detection    = true
    statistics_enabled                 = true
  }


Please find the sample .tf file for a Docker Smart Remote repository:
terraform {
  required_providers {
    artifactory = {
      source = "jfrog/artifactory"
      version = "8.7.0"
    }
  }
}

resource "artifactory_remote_docker_repository" "my-remote-docker-1" {
  key                            = "my-remote-docker-1"
  url                            = "https:/<sourceARTurl>/artifactory/api/docker/<sourceremoterepokey>/"
  username                       = "<username>"
  password                       = "<password>"
  content_synchronisation {
    enabled                          = true
    properties_enabled               = true
    source_origin_absence_detection  = true
    statistics_enabled               = true
  }
}


Note: This is applicable for creating Smart Remote on Edge Nodes too.