generated from kolosovpetro/terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7a00012
Showing
26 changed files
with
1,129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
formatter: "markdown" | ||
|
||
settings: | ||
anchor: false | ||
lockfile: false | ||
|
||
output: | ||
file: "README.md" | ||
|
||
sections: | ||
hide: [requirements] | ||
|
||
content: |- | ||
{{ .Providers }} | ||
{{ .Modules }} | ||
{{ .Resources }} | ||
{{ .Inputs }} | ||
{{ .Outputs }} | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
plugin "azurerm" { | ||
enabled = true | ||
source = "github.com/terraform-linters/tflint-ruleset-azurerm" | ||
version = "0.21.0" | ||
} | ||
|
||
config { | ||
module = true | ||
force = false | ||
disabled_by_default = false | ||
|
||
varfile = ["terraform.tfvars.ci"] | ||
} | ||
|
||
rule "terraform_deprecated_interpolation" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_deprecated_index" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_unused_declarations" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_comment_syntax" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_documented_outputs" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_documented_variables" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_typed_variables" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_module_pinned_source" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_naming_convention" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_required_version" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_required_providers" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_unused_required_providers" { | ||
enabled = true | ||
} | ||
|
||
# Disabled since we have files like "variables-xxxx.tf" instead of a single "variables.tf" | ||
rule "terraform_standard_module_structure" { | ||
enabled = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto eol=lf | ||
*.html linguist-detectable=false | ||
*.cshtml linguist-detectable=false | ||
*.htm linguist-detectable=false | ||
*.razor linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Validate Terraform | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
|
||
workflow_dispatch: | ||
|
||
# schedule: | ||
# - cron: '0 0 * * 0' | ||
|
||
jobs: | ||
build-webapp: | ||
name: Validate Terraform | ||
runs-on: ${{ matrix.environment }} | ||
strategy: | ||
matrix: | ||
environment: | ||
- ubuntu-latest | ||
|
||
env: | ||
DOTNET_NOLOGO: 1 | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
ACTIONS_RUNNER_DEBUG: true | ||
TF_LOG: INFO | ||
ARM_CLIENT_ID: "" | ||
ARM_CLIENT_SECRET: ${{ secrets.TF_ARM_CLIENT_SECRET }} | ||
ARM_SUBSCRIPTION_ID: "" | ||
ARM_TENANT_ID: "" | ||
WORKING_DIR: "./" | ||
|
||
steps: | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: latest | ||
|
||
- name: Terraform Version | ||
run: terraform -v | ||
working-directory: ${{ env.WORKING_DIR }} | ||
|
||
- name: Terraform Init | ||
run: terraform init -backend=false | ||
working-directory: ${{ env.WORKING_DIR }} | ||
|
||
- name: Terraform Validate | ||
run: terraform validate | ||
working-directory: ${{ env.WORKING_DIR }} | ||
|
||
- name: Terraform Format | ||
run: terraform fmt -check | ||
working-directory: ${{ env.WORKING_DIR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.idea | ||
.ssh | ||
*.conf | ||
.terraform | ||
*.tfplan | ||
*.tfstate | ||
*.lock.info | ||
*.tfstate.backup | ||
*.lock.hcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
- id: check-yaml | ||
args: | ||
- --unsafe | ||
- id: check-symlinks | ||
- id: check-added-large-files | ||
- id: detect-private-key | ||
|
||
- repo: https://github.com/antonbabenko/pre-commit-terraform.git | ||
rev: v1.77.1 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_docs | ||
args: | ||
- --hook-config=--path-to-file=README.md | ||
- --hook-config=--add-to-existing-file=true | ||
- --hook-config=--create-file-if-not-exist=true | ||
exclude: '^modules|^example|^tools' | ||
- id: terraform_validate | ||
exclude: '^examples|^modules' | ||
|
||
- id: terraform_tflint | ||
exclude: '^examples' | ||
args: | ||
- --args=--config=__GIT_WORKING_DIR__/.config/tflint.hcl | ||
- --env-vars=TFLINT_LOG="info" |
Oops, something went wrong.