Deploy/Resolve Terraform provider artifact to Artifactory:

ARTIFACTORY: How to configure Terraform repositories in Artifactory

AuthorFullName__c
Tatarao Vana, Logeshwaran R
articleNumber
000005478
ft:sourceType
Salesforce
FirstPublishedDate
2022-11-30T08:56:48Z
lastModifiedDate
2024-04-10T17:38:53Z
VersionNumber
4
While creating the Terraform provider name it is as terraform-provider-<name>. Otherwise, we will get the following error message while performing terraform init.

Error: Failed to install provider

Error while installing testns/test v1.0.0: provider binary not found: could not find executable file starting with terraform-provider-test

Later, zip the created terraform provider and deploy it to the Artifactory using the curl command from the Set Me Up page.

For example:
curl -u<username> -XPUT "https://<Artifactory_URL>/artifactory/logesh-terraform-provider-local/testns/test/1.0.0/terraform-provider-test_1.0.0_darwin_amd64.zip" -T terraform-provider-example.zip

While uploading the provider, we need to make sure that we are providing the correct platform details where we are going to install the provider. Otherwise, we encounter the following error message while installing the provider.
Error: Incompatible provider version
Provider registry.terraform.io/testns/test v1.0.0 does not have a package available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms supported.

In the above context, we deployed a Terraform provider artifact for the platform amd64. Later, we tried to install the same artifact in the arm64 machine which is a different architecture and faced the below error message. Later, we deployed the Terraform provider artifact for arm64 platform and was able to install it.

After successfully deploying the provider file to the local repository, we need to create a main.tf file using the template from the Set Me Up page and then we can perform the terraform init to install the provider.