{"id":18465553,"url":"https://github.com/numtide/generate-terraform-provider-shim","last_synced_at":"2025-04-08T08:31:54.711Z","repository":{"id":54850481,"uuid":"269181762","full_name":"numtide/generate-terraform-provider-shim","owner":"numtide","description":"Handle third-party Terraform providers","archived":false,"fork":false,"pushed_at":"2024-07-26T09:34:17.000Z","size":50,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-02T23:55:51.068Z","etag":null,"topics":["provider-shims","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numtide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-03T19:56:36.000Z","updated_at":"2024-07-26T18:05:57.000Z","dependencies_parsed_at":"2025-01-01T11:01:39.114Z","dependency_job_id":"2f42b7b6-c6cd-4d80-8cf8-7391d7a4efa4","html_url":"https://github.com/numtide/generate-terraform-provider-shim","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.125,"last_synced_commit":"a42e0f7daa66f47f96cd2d7218c664848823ea87"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fgenerate-terraform-provider-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fgenerate-terraform-provider-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fgenerate-terraform-provider-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fgenerate-terraform-provider-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtide","download_url":"https://codeload.github.com/numtide/generate-terraform-provider-shim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804587,"owners_count":20999017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["provider-shims","terraform"],"created_at":"2024-11-06T09:13:33.173Z","updated_at":"2025-04-08T08:31:54.393Z","avatar_url":"https://github.com/numtide.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate Terraform provider shim\n\nThis utility will generate Terraform provider shims for the community providers that are available in GitHub.\n\n## Why shims?\n\nIn the Terraform 0.12.x world, there is no standardized way of installing providers that are not available from Hashicorp's registry, so one is encouraged to check in the binary of the provider together with Terraform files.\nThis leads to unnecessarily bloated git repositories.\nProvider shim solves this issue by replacing the provider binary with a `bash` script that will download and cache on disk binary of the provider and execute it.\nAll of this is completely transparent to the terraform user and once created there is usually no further steps needed to use the providers.\n\nAn example of a shim script is:\n\n```bash\n#!/usr/bin/env bash\n#\n# Generated by generate-terraform-provider-shim: https://github.com/numtide/generate-terraform-provider-shim\n#\n\nset -e -o pipefail\n\nplugin_url=\"https://github.com/numtide/terraform-provider-linuxbox/releases/download/v0.2.2/terraform-provider-linuxbox_v0.2.2_linux_amd64.tar.gz\"\nplugin_unpack_dir=\"${XDG_CACHE_HOME:-$HOME/.cache}/terraform-providers/linuxbox_v0.2.2\"\nplugin_binary_name=\"terraform-provider-linuxbox_v0.2.2\"\nplugin_binary_path=\"${plugin_unpack_dir}/${plugin_binary_name}\"\nplugin_binary_sha1=\"7232dbb6760d34e844ce731226b9eec67c5bb276\"\n\nif [[ ! -d \"${plugin_unpack_dir}\" ]]; then\n    mkdir -p \"${plugin_unpack_dir}\"\nfi\n\nif [[ -f \"${plugin_binary_path}\" ]]; then\n    current_sha=$(git hash-object \"${plugin_binary_path}\")\n    if [[ $current_sha != \"${plugin_binary_sha1}\" ]]; then\n        rm \"${plugin_binary_path}\"\n    fi\nfi\n\nif [[ ! -f \"${plugin_binary_path}\" ]]; then\n    curl -sL \"${plugin_url}\" | tar xzvfC - \"${plugin_unpack_dir}\"\n    chmod 755 \"${plugin_binary_path}\"\nfi\n\ncurrent_sha=$(git hash-object \"${plugin_binary_path}\")\nif [[ $current_sha != \"${plugin_binary_sha1}\" ]]; then\n    echo \"plugin binary sha does not match ${current_sha} != ${plugin_binary_sha1}\" \u003e\u00262\n    exit 1\nfi\n\nexec \"${plugin_binary_path}\" $@\n```\n\nWith the release of Terraform 0.13.x there is a standardized way of distributing the provider binaries, but the burden of running a provider registry and signing provider binaries is on the provider developers. \nThis means that most of the providers will not be immediately available through a registry.\nFor such providers, provider shims is a stopgap solution until community providers can be downloaded through a registry.\n\n## Usage\n\nrunning\n\n```sh\n$ generate-terraform-provider-shim numtide/terraform-provider-linuxbox\n```\n\nwill generate provider shims for Linuxbox provider in the `.terraform/plugins/` and `terraform.d/plugins/registry.terraform.io/hashicorp/linuxbox/\u003cversion\u003e` directories for each arch respectively.\n\n## Terraform 0.13 support\n\nAt the moment, there are plenty of community providers that are not available in the Hashicorp's registry and are not running registries of their own.\nThis will change with time and this tool will become less useful, but for the transition period, this tool will generate shims in the correct paths for both terraform 0.12 and 0.13.\n\nGenerated shims will let providers appear as if they were downloaded through Hashicorp's registry, so there is no need to add an entry in `terraform{ required_providers{} }` specifying the location of the provider registry.\n\n\n## Limitations\n\n### Only GitHub hosted providers\nShim generator is integrating tightly with GitHub's API to find release archives, hence will be able to generate shims only for the providers that are available on GitHub.\n\n(we are open to accepting PRs to support other sources)\n\n### Only providers with releases with attached binaries are supported\nWe are relying on the developers of the provider to create releases with attached compiled binaries of the providers for different architectures.\nIf that is not the case, the shim cannot be generated.\n\n### Only .tar.gz and .zip archives are supported\nThere is no standard way of packaging providers.\nMost of the time they are packaged in a Zip or Gzipped Tar archive - those are formats we are supporting.\nIf you would like us to add support for some other formats, please create an issue in this repo with a link to the specific provider you would like us to support.\n\n### Windows is not supported\nWe do not have access to a Windows machine and have never run terraform in a Windows environment, hence the generated shims will definitely not work under Windows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fgenerate-terraform-provider-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtide%2Fgenerate-terraform-provider-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fgenerate-terraform-provider-shim/lists"}