Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Madh93/tpm
🛠️ A package manager for Terraform providers
https://github.com/Madh93/tpm
cli go golang opentofu terraform terraform-provider
Last synced: about 1 month ago
JSON representation
🛠️ A package manager for Terraform providers
- Host: GitHub
- URL: https://github.com/Madh93/tpm
- Owner: Madh93
- License: mit
- Created: 2023-04-16T21:26:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-11T22:05:19.000Z (10 months ago)
- Last Synced: 2024-08-02T00:26:41.534Z (4 months ago)
- Topics: cli, go, golang, opentofu, terraform, terraform-provider
- Language: Go
- Homepage:
- Size: 2.6 MB
- Stars: 79
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tf - tpm - A package manager for Terraform providers. (Tools / Community providers)
README
# Terraform Provider Manager
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
Terraform Provider Manager (`tpm`) is a command-line interface (CLI) tool designed to simplify the management of [Terraform](https://www.terraform.io/) providers in the [plugin cache directory](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache). With `tpm` you can easily **install, uninstall, and list providers**, helping you to streamline your Terraform workflow.
One of the key benefits of `tpm` is that it **does not require Terraform to be installed**, making it a lightweight and efficient tool for managing your cached providers.
Installation •
Usage •
Useful Links •
License## Installation
### GNU/Linux
Arch Linux from [AUR](https://aur.archlinux.org/packages/terraform-tpm-bin) (maintained by [@jonathanio](https://github.com/jonathanio)):
```shell
yay -S terraform-tpm-bin
```### macOS
Via [Homebrew](https://brew.sh/):
```shell
brew install madh93/tap/tpm
```### Windows
Via [Scoop](https://scoop.sh/):
```shell
scoop bucket add madh93 https://github.com/madh93/scoop-bucket.git
scoop install tpm
```### From releases
Stable binaries for all platforms are available on the [releases page](https://github.com/Madh93/tpm/releases). To install, download the binary for your platform from "Assets", extract the downloaded file and place `tpm` into your `PATH`:
```shell
curl -L https://github.com/Madh93/tpm/releases/latest/download/tpm_$(uname -s)_$(uname -m).tar.gz | tar -xz -O tpm > /usr/local/bin/tpm
chmod +x /usr/local/bin/tpm
```### Go
If you have Go installed:
```shell
go install github.com/Madh93/tpm@latest
```### From source
Install Go if it is not already installed. You can download it from the official [website](https://golang.org/dl).
Clone the Terraform Provider Manager repository to build and install the binary:
```shell
git clone https://github.com/Madh93/tpm && cd tpm && make install
```## Usage
```shell
Terraform Provider Manager is a simple CLI to manage Terraform providers in the Terraform plugin cache directoryUsage:
tpm [flags]
tpm [command]Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
install Install a provider
list List all installed providers
purge Purge all installed providers
uninstall Uninstall a providerFlags:
-c, --config string config file for tpm
-d, --debug enable debug mode
-h, --help help for tpm
-p, --terraform-plugin-cache-dir string the location of the Terraform plugin cache directory (default "/home/user/.terraform.d/plugin-cache")
-r, --terraform-registry string the Terraform registry provider hostname (default "registry.terraform.io")
-v, --version version for tpmUse "tpm [command] --help" for more information about a command.
```### Install a provider
To install a provider you only need to provide the name. Optionally, you can specify a version by using `@`. By default, if no version is specified, the latest available version, also known as `@latest`, will be installed.
You can also specify the architecture and operating system. If not specified, the information from the system where tpm is being executed will be used.
In addition, it's possible to install multiple providers at once specifying a `providers.yml` file, making it easier to share and reuse installation requirements. For example:
```yaml
providers:
- name: hashicorp/[email protected]
- name: hashicorp/[email protected]
os:
- linux
- darwin
arch:
- amd64
- arm64
- name: hashicorp/random
os:
- linux
- darwin
arch:
- amd64
- arm64
```The providers are installed in parallel by default. You can adjust the number of parallel jobs by using the `--jobs ` flag.
### List installed providers
This will display on the screen the installed providers. Optionally, you can specify an output format. Valid output formats are:
- `text` (default)
- `json`
- `csv`
- `table`### Uninstall a provider
Uninstalling a provider is exactly the same as installing it. You can specify both the version, operating system, and architecture.
### Purge all providers
This will delete all installed providers from the current registry.
## Useful Links
- [Terraform](https://www.terraform.io/)
- [Terraform Registry](https://registry.terraform.io/)
- [Terraform Providers Docs](https://developer.hashicorp.com/terraform/language/providers)
- [Terraform Provider Plugin Cache Docs](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache)
- [Terraform plugin caching](https://www.scalefactory.com/blog/2021/02/25/terraform-plugin-caching/)
- [How to Speed Up Terraform in CI/CD Pipelines](https://infinitelambda.com/speed-up-terraform-cicd-pipeline/)## License
This project is licensed under the [MIT license](LICENSE).