Blog-Technical-Content
pre-commit-terraform
Our great sponsors
Blog-Technical-Content | pre-commit-terraform | |
---|---|---|
5 | 13 | |
42 | 2,985 | |
- | - | |
3.4 | 8.7 | |
6 months ago | 3 days ago | |
HCL | Shell | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Blog-Technical-Content
-
Ansible Modules – How To Use Them Efficiently (Examples)
Next, we will go through an example of creating a custom module that takes as input a string that represents an epoch timestamp and converts it to its human-readable equivalent of type datetime in Python. You can find the code for this tutorial on this repository.
-
Ansible Roles: Basics & How to Combine Them With Playbooks
This is an example play to try out our new webserver role. Let’s go ahead and execute this play. To follow along, you should first run the vagrant up command from the top directory of this repository to create our target remote host.
-
Terraform Output Values : Complete Guide & Examples
Let’s examine how we can use all this in a real-world example. In this GitHub repository, we define the Terraform configuration for this example’s infrastructure. To follow along, you will need to install Terraform, have an AWS account ready, and authenticate with your AWS keys via the command line. Note that you might be charged a few dollars in your AWS account if you follow along.
-
How to Use Different Types of Ansible Variables(Examples)
If you are still learning how to use Ansible, you might also find helpful the introductory Ansible Tutorial or Working with Ansible Playbooks blog posts. You can find this article’s code on this repository if you wish to follow along.
-
Terraform Best Practices for Better Infrastructure Management
Our primary entry point is main.tf, and in simple use cases, we can add all our resources there. We define our variables in variables.tf and assign values to them in terraform.tfvars. We use the file outputs.tf to declare output values. You can find a similar example project structure here.
pre-commit-terraform
-
whats your development process for github actions and how are you testing them?
Personally I use pre-commit with some of these hooks in addition to some default hooks. It's basically a localised CI pipeline, and also means every commit has passed checks so keeps your commit history neat. Way faster to develop infrastructure code and fix issues than having to keep pushing to the remote repo and waiting for an Action to run.
- Breve guia de sobrevivência com Terraform
- Trying to learn pre-commit - how to handle multiple hooks in a small monorepo with different paths?
-
List of most useful Terraform open-source tools
https://github.com/antonbabenko/pre-commit-terraform because Terraform/Terragrunt configs should be documented, tidy and valid all the time :)
-
Terraform Module Template
Local testing with pre-commit-terraform. Formats code with terraform fmt Validates code with terraform validate Automatic README updates with terraform-docs. Static code analysis with TFLint, tfsec and checkov.
-
Hugo no theme
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca47c31..3e5cfef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,10 @@ repos: rev: v2.7.1 hooks: - id: prettier - types_or: [yaml, markdown, json] + types_or: [yaml, markdown, json, html] + additional_dependencies: + - "[email protected]" + - "[email protected]" - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.74.1 hooks:
-
Terraform Best Practices for Better Infrastructure Management
pre-commit-terraform – Pre-commit git hooks for automation
-
Using pre-commits hooks to improve terraform IaC code quality
Let me share a shameless plug (as an author of the pre-commit-terraform). I will show these hooks in action and answer questions during my live stream on Friday 29th of October - https://www.youtube.com/watch?v=ziJK79tI6tY
-
Best approach to manage S3
We the following of this set of hooks for our Terraform modules:
-
Can you validate ".tf" files via a script ?
Take a look on pre-commit scripts for terraform: https://github.com/antonbabenko/pre-commit-terraform. Of course, you can run it before git operations, for example:
What are some alternatives?
terraform-cost-estimation - Anonymized, secure, and free Terraform cost estimation based on Terraform plan (0.12+) or Terraform state (any version)
plantuml-githook - A Git hook which spots PlantUML source files and generates diagrams in a structured way
terratest - Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.
pre-commit-hooks - Some out-of-the-box hooks for pre-commit
checkov - Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
tfsec - Security scanner for your Terraform code [Moved to: https://github.com/aquasecurity/tfsec]
atlantis - Terraform Pull Request Automation
terragrunt - Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
tfenv - Terraform version manager
Vagrant - Vagrant is a tool for building and distributing development environments.