https://github.com/aidanmelen/terraform-shell-whalebrew
Manage Whalebrew packages with Terraform.
https://github.com/aidanmelen/terraform-shell-whalebrew
Last synced: 3 months ago
JSON representation
Manage Whalebrew packages with Terraform.
- Host: GitHub
- URL: https://github.com/aidanmelen/terraform-shell-whalebrew
- Owner: aidanmelen
- License: other
- Created: 2020-10-12T14:25:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-12T15:59:38.000Z (over 4 years ago)
- Last Synced: 2025-01-13T15:52:07.363Z (4 months ago)
- Language: HCL
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/aidanmelen/terraform-shell-whalebrew/actions)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/ps-data/cookiecutter-tfe-workspace)
[](https://github.com/terraform-linters/tflint)# terraform-shell-whalebrew
Manage [Whalebrew](https://github.com/whalebrew/whalebrew) packages with Terraform.
> Whalebrew creates aliases for Docker images so you can run them as if they were native commands. It's like Homebrew, but with Docker images.
## Assumptions
This project assumes that you have Docker, Whalebrew, and Terraform installed.
## Usage
Use the [terraform.tfvars](https://github.com/aidanmelen/terraform-shell-whalebrew/blob/main/terraform.tfvars) file to define a list of Whalebrew packages to install. Add a package to the list and it will be installed. Remove a package from the list and it will be uninstalled.
```
whalebrew_images = [
"whalebrew/whalesay", # stable whalebrew optimized docker image.
"hashicorp/terraform:0.13.0" # non optimized docker image, but still works.
"aidanmelen/terraform-docs", # some docker images that I wrapped with whalebrew docker labels.
"aidanmelen/tflint",
"aidanmelen/tfsec",
"aidanmelen/pre-commit",
"aidanmelen/cookiecutter",
]
```[Here](https://github.com/whalebrew/whalebrew-packages/) is a complete list of stable Whalebrew packages. Note that most Dockerized command line tools will work with Whalebrew.
Then run the Terraform core workflow.
```bash
terraform init
terraform plan
terraform apply
```## Known Issues
Whalebrew (`<= 0.2.3`) requires a confirm prompt to uninstall packages. This manual procedure is great for protecting against the accidental uninstallment of packages, but it breaks the uninstall automation for the Shell provider. The work around solution can be found here in this [pull request](https://github.com/whalebrew/whalebrew/pull/107).
## Makefile Targets
```text
Available targets:install Initialize and install pre-commit
lint Lint terraform code
```## License
MIT Licensed. See [LICENSE](https://github.com/aidanmelen/terraform-shell-whalebrew/tree/master/LICENSE) for full details.
## Credits
Special thanks to the [maintainers and contributors](https://github.com/whalebrew/whalebrew/graphs/contributors) of Whalebrew!
See [docs/credits.md](https://github.com/aidanmelen/terraform-shell-whalebrew/tree/master/docs/credits.md) for full details.
## Requirements
| Name | Version |
|------|---------|
| terraform | >= 0.12.0 |
| shell | 1.7.3 |## Providers
| Name | Version |
|------|---------|
| shell | 1.7.3 |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| whalebrew\_images | Images to install with Whalebrew. | `list(string)` | `[]` | no |## Outputs
| Name | Description |
|------|-------------|
| whalebrew\_list | A list of packages installed with Whalebrew. Also see `whalebrew list`. |