Private Registry Provider Commands
The ability to manage Providers within an Organization was added to Terraform Enterprise in release v202206-1. These commands make the management of these providers via the API (the only way to manage said providers) easier.
To copy a provider from the public Terraform Registry into a private registry, see Syncing Providers to a Private Registry.
Note: Create, show, list, and delete operate on private registry providers.
tfx registry provider downloadfetches artifacts from the public Terraform Registry so they can be staged and then uploaded with the existing create commands.
There are several “resources” needed to create a Provider in the Registry that have a dependency hierarchy.
classDiagram Provider --|> ProviderVersion ProviderVersion --|> ProviderVersionPlatform class Provider{ +String Name, Example: "aws" } class ProviderVersion{ +String Version, Example: "1.0.0" +String SHASUMS +String SHASUMSSIG +String GPG Key Id } class ProviderVersionPlatform{ +String OS, Example: "linux" +String ARCH, Example: "amd64" +String Binary }tfx registry provider list
List Providers in the Registry.
Example:
$ tfx registry provider listUsing config file: /Users/tstraub/.tfx.hclList Providers in Registry for Organization: firefly╭─────────┬──────────┬───────────────────────┬──────────────────────────╮│ NAME │ REGISTRY │ ID │ PUBLISHED │├─────────┼──────────┼───────────────────────┼──────────────────────────┤│ aws │ private │ prov-xT3mHHwFEe9BA62L │ 2022-07-15T18:30:33.218Z ││ azurerm │ private │ prov-zhufbe1gdvHxyrzV │ 2022-07-15T18:41:04.675Z ││ random │ private │ prov-A8tqWgWykT3ecb1h │ 2022-07-15T18:43:37.771Z │╰─────────┴──────────┴───────────────────────┴──────────────────────────╯tfx registry provider create
Create a Provider in the Registry.
Example:
$ tfx registry provider create --name googleUsing config file: /Users/tstraub/.tfx.hclCreate Provider in Registry for Organization: fireflyProvider Created: googleID: prov-tAaS9tEKZFMTr53fNamespace: fireflyCreated: 2022-08-13T17:34:38.067Ztfx registry provider show
Show details of a Provider in the Registry.
Example:
$ tfx registry provider show --name googleUsing config file: /Users/tstraub/.tfx.hclShow Provider in Registry for Organization: fireflyName: googleID: prov-tAaS9tEKZFMTr53fNamespace: fireflyCreated: 2022-08-13T17:34:38.067Ztfx registry provider delete
Delete a Provider in the Registry.
Example:
$ tfx registry provider delete --name googleUsing config file: /Users/tstraub/.tfx.hclDelete Provider in Registry for Organization: fireflyProvider Deleted: googleStatus: Successtfx registry provider download
Download a provider from the public Terraform Registry and stage the files locally for a later private-registry upload.
This command does not require a TFE/HCP Terraform token. It uses the public registry protocol (registry.terraform.io) and follows the same URLs Terraform uses during terraform init.
--directory is the base path (default ./providers). Files are always written to <directory>/<namespace>/<name>/<version>/. The public-registry namespace (who published the provider on registry.terraform.io) is a folder in that path. Official providers use --namespace hashicorp (the default). Third-party providers use their publisher, e.g. --namespace chainguard-dev.
Default platforms: linux_amd64, darwin_arm64, darwin_amd64, windows_amd64. Use --platforms to choose a subset, or --all-platforms to fetch every published zip.
The GPG public key is always saved as <KEYID>.asc, including for the hashicorp namespace. Official HashiCorp providers are signed with HashiCorp’s public GPG keys, which are publicly available and pre-installed on Terraform Enterprise v202309-1 and newer. Third-party providers use their own keys, which are not pre-installed; tfx registry provider version create --directory uploads them to the private registry (the TFE/HCP organization) when missing.
After upload, Terraform configs must source the provider as <hostname>/<organization>/azurerm — not hashicorp/azurerm.
Unlike tfx registry module version download (from the private registry), this command downloads from the public registry.
Example:
$ tfx registry provider download --name azurerm --version 5.0.0Download Provider from Public RegistryProvider: hashicorp/azurerm 5.0.0Platforms: linux_amd64, darwin_arm64, darwin_amd64, windows_amd64Downloading provider artifacts...Namespace: hashicorpName: azurermVersion: 5.0.0Directory: ~/example/providers/hashicorp/azurerm/5.0.0GPG Key ID: <hashicorp signing key>GPG Public Key: ~/example/providers/hashicorp/azurerm/5.0.0/<KEYID>.ascSHA256SUMS: ~/example/providers/hashicorp/azurerm/5.0.0/terraform-provider-azurerm_5.0.0_SHA256SUMSSHA256SUMS.sig: ~/example/providers/hashicorp/azurerm/5.0.0/terraform-provider-azurerm_5.0.0_SHA256SUMS.72D7468F.sigStaged layout:
./providers/hashicorp/azurerm/5.0.0/ <KEYID>.asc terraform-provider-azurerm_5.0.0_SHA256SUMS terraform-provider-azurerm_5.0.0_SHA256SUMS.72D7468F.sig terraform-provider-azurerm_5.0.0_linux_amd64.zip terraform-provider-azurerm_5.0.0_darwin_arm64.zip terraform-provider-azurerm_5.0.0_darwin_amd64.zip terraform-provider-azurerm_5.0.0_windows_amd64.zipThen upload with:
tfx registry provider version create --directory ./providers/hashicorp/azurerm/5.0.0The provider is created automatically if it does not already exist. --directory uploads the version checksums and every zip in that folder.
$ tfx registry provider download --name azurerm --version 5.0.0 --platforms linux_amd64 --directory ./providersThird-party providers
Third-party publishers use their own GPG keys. Download with --namespace set to the public-registry publisher (not hashicorp):
tfx registry provider download --namespace chainguard-dev --name cosign --version 0.4.16tfx registry provider version create --directory ./providers/chainguard-dev/cosign/0.4.16version create --directory reads the public-registry namespace from the staged folder path (<namespace>/<name>/<version>). When it is not hashicorp, the command checks whether that provider’s GPG key already exists in the private registry (the TFE/HCP organization) and creates it from the staged .asc file if missing.
A provider is in the HashiCorp namespace only when that path namespace equals hashicorp (case-insensitive). The provider name and the GPG key ID are not used for this decision.
tfx registry provider version list
List Versions for a Provider in the Registry.
tfx registry provider version platform list
List Platforms for a Provider Version in the Registry.
tfx registry provider version create
Create a Version for a Provider in the Registry.
From a staged download directory
After tfx registry provider download, pass the version folder. Namespace, name, version, GPG key id, SHA256SUMS, signature, and platform zips are inferred. The provider is created if it does not exist. For third-party providers (public-registry namespace is not hashicorp), the GPG public key is uploaded to the organization if it is not already present. --key-id overrides the inferred GPG key. Platform zips upload in parallel; --concurrency defaults to 4.
tfx registry provider version create --directory ./providers/hashicorp/azurerm/5.0.0tfx registry provider version create --directory ./providers/hashicorp/aws/6.60.0 --concurrency 4From explicit files
--shasums is the path to the SHA256SUMS file. --shasums-sig is the path to the signature file. This path creates the version only; upload platforms separately with tfx registry provider version platform create.
SHAMSUM File Content Example:
e31c31d00f42ea2dbaab1ad4c245da5cfff63e28399b5a5795b5e6a826c6c8af terraform-provider-aws_4.3.0_darwin_amd64.zipde166ecfeed70f570cea72ec094f00c2f997496b3226fa08518e7cd4a73884e1 terraform-provider-aws_4.3.0_darwin_arm64.zipf93725afd8410194ede51d83505327aa1ae6a9b4280cf31db649c62c7dc203ae terraform-provider-aws_4.3.0_freebsd_386.zip087c67e5429f343a164221c05a83f152322f411e7394f8a39ed81a75982af1f2 terraform-provider-aws_4.3.0_freebsd_amd64.zip2e852a1b107e5324524874e1cd98bcf3a69284b4fe04750aa373054177c54214 terraform-provider-aws_4.3.0_freebsd_arm.zip4b9a54b5895f945827832e6ddd16ff107301fedf47acbd83d17d4e18bbf10bb1 terraform-provider-aws_4.3.0_linux_386.zip64dfc02bc85f5df2f51ff942fc78d72fcd0db17b0f53e1fae380e58adbd239b3 terraform-provider-aws_4.3.0_linux_amd64.zipc51f5b238af37c63e9033a12fd7fedc87c03eb966f5f5c7786eb6246e8bf3071 terraform-provider-aws_4.3.0_linux_arm.zipd0df94d3112a25de609dfb55c5e3b0d119dea519a2bdd8099e64a8d63f22b683 terraform-provider-aws_4.3.0_linux_arm64.zip90048d87ff3071a4356cf91916b46a7ec69ba55bcba5765b598d3fe545d4c6ca terraform-provider-aws_4.3.0_windows_386.zip766f9aef619cfd23e924aee523791acccd30b6d8f1cc0ed1a7b5c953bf8c5392 terraform-provider-aws_4.3.0_windows_amd64.zip$ tfx registry provider version create --name random --version 4.3.0 --key-id <gpg-key-id> --shasums ./terraform-provider-random_3.1.0_SHA256SUMS --shasums-sig=./terraform-provider-random_3.1.0_SHA256SUMS.sigUsing config file: /Users/tstraub/.tfx.hclCreate Provider Version in Registry for Organization: fireflyProvider Name: randomUploading shasums and sig~/hashicorp-services.github.com/pmr-providers-guide/providers/random/3.1.0/terraform-provider-random_3.1.0_SHA256SUMS ~/hashicorp-services.github.com/pmr-providers-guide/providers/random/3.1.0/terraform-provider-random_3.1.0_SHA256SUMS.sig 2022-08-20T18:27:13.859ZProvider Version CreatedName: randomID: provver-ujrSC8txwA62a1uzVersion: 4.3.0Created: 2022-08-20T18:27:13.859Ztfx registry provider version show
Show details a Version for a Provider in the Registry.
Example:
$ tfx registry provider version show --name aws --version 4.3.0Using config file: /Users/tstraub/.tfx.hclShow Provider Version in Registry for Organization: fireflyName: awsVersion: 4.3.0ID: provver-pmXF2YXLARN8ZpYpShasums Uploaded: trueShasums Sig Uploaded: trueShasums:e31c31d00f42ea2dbaab1ad4c245da5cfff63e28399b5a5795b5e6a826c6c8af terraform-provider-aws_4.3.0_darwin_amd64.zipde166ecfeed70f570cea72ec094f00c2f997496b3226fa08518e7cd4a73884e1 terraform-provider-aws_4.3.0_darwin_arm64.zipf93725afd8410194ede51d83505327aa1ae6a9b4280cf31db649c62c7dc203ae terraform-provider-aws_4.3.0_freebsd_386.zip087c67e5429f343a164221c05a83f152322f411e7394f8a39ed81a75982af1f2 terraform-provider-aws_4.3.0_freebsd_amd64.zip2e852a1b107e5324524874e1cd98bcf3a69284b4fe04750aa373054177c54214 terraform-provider-aws_4.3.0_freebsd_arm.zip4b9a54b5895f945827832e6ddd16ff107301fedf47acbd83d17d4e18bbf10bb1 terraform-provider-aws_4.3.0_linux_386.zip64dfc02bc85f5df2f51ff942fc78d72fcd0db17b0f53e1fae380e58adbd239b3 terraform-provider-aws_4.3.0_linux_amd64.zipc51f5b238af37c63e9033a12fd7fedc87c03eb966f5f5c7786eb6246e8bf3071 terraform-provider-aws_4.3.0_linux_arm.zipd0df94d3112a25de609dfb55c5e3b0d119dea519a2bdd8099e64a8d63f22b683 terraform-provider-aws_4.3.0_linux_arm64.zip90048d87ff3071a4356cf91916b46a7ec69ba55bcba5765b598d3fe545d4c6ca terraform-provider-aws_4.3.0_windows_386.zip766f9aef619cfd23e924aee523791acccd30b6d8f1cc0ed1a7b5c953bf8c5392 terraform-provider-aws_4.3.0_windows_amd64.ziptfx registry provider version delete
Delete a Version for a Provider in the Registry.
Example
$ tfx registry provider version delete --name aws --version 4.3.0Using config file: /Users/tstraub/.tfx.hclDelete Provider Version in Registry for Organization: fireflyProvider Version Deleted: awsStatus: Successtfx registry provider version platform create
Create a Platform Version for a Provider in the Registry.
Example
$ tfx registry provider version platform create --name aws --version 4.3.0 --os darwin --arch amd64 -f ./terraform-provider-aws_4.3.0_darwin_amd64.zipUsing config file: /Users/tstraub/.tfx.hclCreate Provider Platform in Registry for Organization: fireflyHashing Provider FileBuilding Provider Filename terraform-provider-random_4.3.0_darwin_amd64.zipUploading Provider Version Platform...Provider Platform Created:ID: provpltfrm-mCPKwkHwLyvhPchSOS: darwinArch: amd64tfx registry provider version platform show
Show details of a Platform Version for a Provider in the Registry.
Example
$ tfx registry provider version platform show --name aws --version 4.3.0 --os darwin --arch amd64Using config file: /Users/tstraub/.tfx.hclShow Provider Platform in Registry for Organization: fireflyName: awsID: provpltfrm-mCPKwkHwLyvhPchSVersion: 4.3.0OS: darwinARCH: amd64Filename: terraform-provider-aws_4.3.0_darwin_amd64.zipShasum: e31c31d00f42ea2dbaab1ad4c245da5cfff63e28399b5a5795b5e6a826c6c8aftfx registry provider version platform delete
Delete a Platform Version for a Provider in the Registry.
Example
$ tfx registry provider version platform delete --name aws --version 4.3.0 --os darwin --arch amd64Using config file: /Users/tstraub/.tfx.hclDelete Provider Platform in Registry for Organization: fireflyProvider Version Deleted: awsStatus: Success