https://github.com/devops-infra/action-terraform-validate
GitHub Action that will run terraform validate.
https://github.com/devops-infra/action-terraform-validate
automation christophshyper ci-cd docker github-actions terraform
Last synced: 8 months ago
JSON representation
GitHub Action that will run terraform validate.
- Host: GitHub
- URL: https://github.com/devops-infra/action-terraform-validate
- Owner: devops-infra
- License: mit
- Created: 2020-04-05T13:38:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T07:36:57.000Z (8 months ago)
- Last Synced: 2024-10-29T08:25:39.371Z (8 months ago)
- Topics: automation, christophshyper, ci-cd, docker, github-actions, terraform
- Language: Dockerfile
- Homepage: https://christophshyper.github.io/
- Size: 133 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# GitHub Action validating Terraform modules
**GitHub Action automatically validating Terraform modules.**
Dockerized as [devopsinfra/action-terraform-validate](https://hub.docker.com/repository/docker/devopsinfra/action-terraform-validate).
Features:
* Main action is using `terraform validate`.
* It's a stripped down image of my other creation - [devops-infra/docker-terragrunt](https://github.com/devops-infra/docker-terragrunt) - framework for managing Infrastructure-as-a-Code.
* it's main use will be everywhere where [Terraform](https://github.com/hashicorp/terraform) is used and is great for statically or actively checking modules' sources.## Badge swag
[](https://github.com/devops-infra/action-terraform-validate/actions?query=workflow%3A%22Master+branch%22)
[](https://github.com/devops-infra/action-terraform-validate/actions?query=workflow%3A%22Other+branches%22)
[




](https://github.com/devops-infra/action-terraform-validate "shields.io")
[




](https://hub.docker.com/r/devopsinfra/action-terraform-validate "shields.io")## Reference
```yaml
- name: Validate Terraform modules
uses: devops-infra/[email protected]
with:
dir_filter: modules
```| Input Variable | Required | Default | Description |
| -------------- | -------- | ------- | ------------------------------------------------------------------------------------ |
| dir_filter | No | `*` | Prefixes or sub-directories to search for Terraform modules. Use comma as separator. |## Examples
Validate whole Terraform setup in repository root. Run the Action via GitHub.
```yaml
name: Validate Terraform
on:
push
jobs:
terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Validate Terraform configuration
uses: devops-infra/[email protected]
```Validate Terraform modules only in `modules/aws` and `modules/gcp` directories. Run the Action via DockerHub.
```yaml
name: Validate Terraform
on:
push
jobs:
terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Validate Terraform modules
uses: devops-infra/[email protected]
with:
dir_filter: modules/aws,modules/gcp
```