When configuring remote repositories on Artifactory Edge nodes using the Artifactory Terraform Provider, you may encounter the following error:
"Failed to create repository 'xxx'. Details: Only smart remote repositories are supported with Artifactory Edge license."
This error occurs because Artifactory Edge supports only Smart Remote repositories. Any remote repository that cannot be validated as Smart Remote is rejected, whether created via Terraform, REST API, or other automation tools.
A Smart Remote Repository is a remote repository that points to another Artifactory instance. On Edge nodes, standard (non-smart) remote repositories are not supported, making Smart Remote configuration mandatory.
Basic Requirements
To be recognized as a Smart Remote repository, the following conditions must be met:
- The remote repository must point to another Artifactory repository
- The repository configuration must allow content synchronization
Configuring a Smart Remote Repository Using Terraform
When defining a remote repository resource using the Artifactory Terraform Provider, ensure the following:
- Use the appropriate artifactory_remote_*_repository resource
- Ensure the url points to a valid Artifactory repository endpoint
- Configure authentication to the remote Artifactory
- Enable content synchronization
A full list of attributes common to all remote repository resources is available in the official Terraform documentation for the Artifactory provider.
Sample Terraform Configuration
main.tf:
terraform {
required_providers {
artifactory = {
source = "jfrog/artifactory"
version = "12.11.1"
}
platform = {
source = "jfrog/platform"
version = "2.2.7"
}
}
}
provider "artifactory" {
url = "https://testA.jfrog.io/artifactory"
access_token = "xxx"
}
variable "remote_username" {
type = string
}
variable "remote_password" {
type = string
sensitive = true
}
resource "artifactory_remote_generic_repository" "test-smart-remote" {
key = "test-smart-remote"
# MUST point to another Artifactory repository
url = "https://testB.jfrog.io/artifactory/shis-generic"
username = var.remote_username
password = var.remote_password
# Smart Remote recommended settings
content_synchronisation {
enabled = true
statistics_enabled = true
}
}After applying the configuration:
artifactory_remote_generic_repository.test-smart-remote: Creating...
artifactory_remote_generic_repository.test-smart-remote: Creation complete after 2s
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Snippet from the UI:
References:
Smart-remote-repositories
Terraform Artifactory remote resource