https://github.com/small-hack/smol-terraform-base
Terraform tips, notes, and best practices
https://github.com/small-hack/smol-terraform-base
Last synced: 3 months ago
JSON representation
Terraform tips, notes, and best practices
- Host: GitHub
- URL: https://github.com/small-hack/smol-terraform-base
- Owner: small-hack
- License: mit
- Created: 2023-02-18T13:17:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T21:35:52.000Z (over 1 year ago)
- Last Synced: 2025-02-26T05:36:38.965Z (over 1 year ago)
- Language: HCL
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example base terraform module
Here's where we'll put some example base terraform modules and best practices.
## Precommit Hooks
We'll be using [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform) to keep the code tidy!
The precommit hooks help with:
- formatting the code
- validating the code
- linting the code
- documenting the code
- security scanning, probably...?
- maybe even infra cost checking :shrug:
### Install Dependencies
- tflint
- jq
- terraform-docs
- pre-commit
- checkov (I haven't tested this one)
- infracost (not tested)
To install the pre-commit hooks for this repo use:
### Setup Precommit for the first time after cloning locally
```bash
# initialize terraform for the first time
terraform init
# run this from the root directory of the repo
pre-commit install
```
To test the pre-commit hooks for this repo use:
```bash
# run this from the root directory of the repo
pre-commit run
```