You can publish Terraform providers via the REST API. When using this method, you can deploy by checksum or from an archive.
For example, to deploy a Terraform provider to a repository called Terraform-local, you could use the following:
Provider Registry Protocol
To deploy a Terraform provider into an Artifactory repository, deploy the required files.
Run these commands with the relevant namespace, provider name (system), version, operating system (OS) and architecture:
Provider binary .zip file:
curl -u<USERNAME>:<TOKEN> -XPUT "https://[JFrogPlatformURL]/artifactory/<REPOSITORY-KEY>/<NAMESPACE>/<PROVIDER-NAME>/<VERSION>/terraform-provider-<PROVIDER-NAME>_<VERSION>_<OS>_<ARCH>.zip" -T <PATH_TO_FILE>For Example:
curl -uadmin:cmVmdGtuOM2JoWVF4WU9vajVnQ2JKc1J1 -XPUT "https://company.jfrog.io/artifactory/Terraform-local/terraform-main-provider/hashicorp/null/3.1.0/terraform-provider-null_3.1.0_linux_amd64.zip" -T test-provider-linux-amd64.zipGPG signature .sig file:
curl -u<USERNAME>:<TOKEN> -XPUT "https://[JFrogPlatformURL]/artifactory/<REPOSITORY-KEY>/<NAMESPACE>/<PROVIDER-NAME>/<VERSION>/terraform-provider-<PROVIDER-NAME>_<VERSION>_SHA256SUMS.sig" -T <PATH_TO_FILE>For Example:
curl -uadmin:cmVmdGtuOM2JoWVF4WU9vajVnQ2JKc1J1 -XPUT "https://company.jfrog.io/artifactory/Terraform-local/terraform-main-provider/hashicorp/null/3.1.0/terraform-provider-null_3.1.0_SHA256SUMS.sig" -T terraform-provider-null_3.1.0_SHA256SUMS.sigSHA256SUMS file:
curl -u<USERNAME>:<TOKEN> -XPUT "https://[JFrogPlatformURL]/artifactory/<REPOSITORY-KEY>/<NAMESPACE>/<PROVIDER-NAME>/<VERSION>/terraform-provider-<PROVIDER-NAME>_<VERSION>_SHA256SUMS" -T <PATH_TO_FILE>For Example:
curl -uadmin:cmVmdGtuOM2JoWVF4WU9vajVnQ2JKc1J1 -XPUT "https://company.jfrog.io/artifactory/Terraform-local/terraform-main-provider/hashicorp/null/3.1.0/terraform-provider-null_3.1.0_SHA256SUMS" -T terraform-provider-null_3.1.0_SHA256SUMS
where:
[JFrogPlatformURL]: The URL of your JPD<USERNAME>: Your JPD Username<TOKEN>: Your JPD Password<REPOSITORY-KEY>: The name of your repository<NAMESPACE>: The owner or organization for this provider<PROVIDER-NAME>: The name of the provider<VERSION>: The specific version of the provider you are deploying<OS>: The target operating system for this provider build<ARCH>: The target CPU architecture for this provider build<PATH_TO_FILE>: This points to the file on your local machine that is being sent to Artifactory
Network Mirror
The required parameters are namespace, provider-name (system), version, operating-system (os) and architecture (arch) as follows:
curl -u<USERNAME>:<TOKEN> -XPUT "https://[JFrogPlatformURL]/artifactory/<REPOSITORY-KEY>/<NAMESPACE>/<PROVIDER-NAME>/<VERSION>/terraform-provider-<PROVIDER-NAME>_<VERSION>_<OS>_<ARCH>.zip" -T <PATH_TO_FILE>For Example:
curl -uadmin:cmVmdGtuOM2JoWVF4WU9vajVnQ2JKc1J1 -XPUT "https://company.jfrog.io/artifactory/Terraform-local/terraform-main-provider/hashicorp/null/3.1.0/terraform-provider-null_3.1.0_linux_amd64.zip" -T test-provider-linux-amd64.zip