Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukecarrier/terraform-provider-command
Execute commands and extract output
https://github.com/lukecarrier/terraform-provider-command
Last synced: about 1 month ago
JSON representation
Execute commands and extract output
- Host: GitHub
- URL: https://github.com/lukecarrier/terraform-provider-command
- Owner: LukeCarrier
- License: mpl-2.0
- Created: 2021-09-04T11:16:26.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-07T22:25:12.000Z (5 months ago)
- Last Synced: 2024-06-19T19:44:02.297Z (5 months ago)
- Language: Go
- Homepage: https://registry.terraform.io/providers/LukeCarrier/command
- Size: 131 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Command Terraform provider
Execute commands and extract output.
---
## Usage
Initialise the provider:
```hcl
terraform {
required_providers {
command = {
source = "LukeCarrier/command"
}
}
}provider "command" {}
```Then use the data source:
```hcl
TODOoutput "json_multi" {
value = TODO
}
```## Hacking
Get the dependencies:
```console
go mod download
go build
```Run the unit tests:
```console
go test ./...
```To test a Terraform state, you'll need to create a `.terraformrc` and set `TF_CLI_CONFIG_FILE` to its path. See `/integration/fixtures/example.terraformrc` for an example.
## Signing
Generate a new key (use [Keybase](https://keybase.io/), GnuPG's CLI is a dumpster fire), then import it into a temporary local keyring:
```console
export GNUPGHOME="$(mktemp -d)"
keybase pgp export -q email@addr -s \
| gpg --import --allow-secret-key-import --pinentry-mode=loopback
```Export the private key, and paste the result into a new GitHub secret named `GPG_PRIVATE_KEY`:
```console
gpg --armor --export-secret-key email@addr
```Add the passphrase to a secret named `PASSPHRASE`.
Finally, export the public key and paste the result into the [Terraform registry](https://registry.terraform.io/settings/gpg-keys):
```console
gpg --armor --export email@addr
```