ARTIFACTORY: How to resolve license-related errors in Terraform

Nitay Marciano
2022-01-30 12:12

Background

Terraform is an IAC (infrastructure as a code) tool that allows you to build, change, and version infrastructure safely and efficiently. This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, Saas features, etc.

Terraform users define their entire infrastructure by simply using configuration files and version control. There is an Artifactory provider plugin for Terraform and a blog about how to integrate it. 

The issue:

These are a few license-related errors that have been encountered: "status" : 403,
"message" : "Forbidden"

"status" : 400,
"message" : "Artifactory Online does not require license, Please contact support@jfrog.com for further assistance if required."

Error: Artifactory requires Enterprise license to work with Terraform!

│ with provider["registry.terraform.io/jfrog/artifactory"],

The cause:

As of version 2.6.22, the provider section contains the attribute “check_license”, which by default is set to true. However, although the errors seem to point out a problem about a license, there is no real need for one as a license is not mandatory in the provider section. Therefore this leads to one of these unexpected error messages, which can be fixed.

The resolution:

In order to get the terraform to work, assuming everything else is working correctly, simply change: check_license = falsewhich is in the provider section.

Notes 

This attribute’s default has been changed to false since then, however, this error may still occur.

Additional Reads

Replicate Artifactory configuration with Terraform provider plugin – A short JFrog article on how to use the Terraform Plugin with Artifactory, including a short demo video.
JFrog Artifactory Terraform provider gains Xray functionality – A short JFrog article that shows how to integrate Terraform with Xray as well.