-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From inf-base : Terraform, TFLint, Pre-commit, providers upgraded
- Loading branch information
Richard Quadling
authored and
Richard Quadling
committed
Sep 30, 2024
1 parent
6bfccdd
commit a735517
Showing
8 changed files
with
144 additions
and
68 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ jobs: | |
strategy: | ||
matrix: | ||
terraform_version: | ||
- 1.9.6 | ||
- 1.9.5 | ||
- 1.9.4 | ||
- 1.9.3 | ||
|
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.7.5 | ||
1.9.6 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,32 +1,108 @@ | ||
config { | ||
module = true | ||
force = false | ||
call_module_type = "all" | ||
force = false | ||
format = "compact" | ||
} | ||
|
||
tflint { | ||
required_version = ">= 0.53" | ||
} | ||
|
||
// Only the AWS plugin is enabled. The Google and Azure plugins are not enabled as we have no current use for them. | ||
plugin "aws" { | ||
enabled = true | ||
source = "github.com/terraform-linters/tflint-ruleset-aws" | ||
version = "0.30.0" | ||
version = "0.33.0" | ||
deep_check = true | ||
} | ||
|
||
rule "terraform_naming_convention" { | ||
# | ||
# Please check https://github.com/terraform-linters/tflint-ruleset-terraform/tree/v0.5.0/docs/rules for new rules | ||
# (adjust the version accordinginly) | ||
# | ||
|
||
# Use '#' for comments rather than '//'. | ||
rule "terraform_comment_syntax" { | ||
enabled = true | ||
} | ||
|
||
# List items should be accessed using square brackets | ||
rule "terraform_deprecated_index" { | ||
enabled = true | ||
} | ||
|
||
# Interpolation-only expressions are deprecated in Terraform v0.12.14 | ||
rule "terraform_deprecated_interpolation" { | ||
enabled = true | ||
} | ||
|
||
# Lookup with 2 arguments is deprecated | ||
rule "terraform_deprecated_lookup" { | ||
enabled = true | ||
} | ||
|
||
# Outputs require a description | ||
rule "terraform_documented_outputs" { | ||
enabled = true | ||
} | ||
|
||
# Variables require a description | ||
rule "terraform_documented_variables" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_module_pinned_source" { | ||
# Comparing a collection with an empty list is invalid. To detect an empty collection, check its length | ||
rule "terraform_empty_list_equality" { | ||
enabled = true | ||
} | ||
|
||
# Disallow specifying a git or mercurial repository as a module source without pinning to a version | ||
rule terraform_module_pinned_source { | ||
enabled = true | ||
} | ||
|
||
# Ensure that all modules sourced from a Terraform Registry specify a version | ||
rule "terraform_module_version" { | ||
enabled = true | ||
exact = false # default | ||
} | ||
|
||
# Enforces naming conventions | ||
rule "terraform_naming_convention" { | ||
enabled = true | ||
format = "snake_case" | ||
} | ||
|
||
# Require that all providers specify a source and version constraint through required_providers | ||
rule "terraform_required_providers" { | ||
enabled = true | ||
|
||
# defaults | ||
source = true | ||
version = true | ||
} | ||
|
||
# Disallow terraform declarations without required_version | ||
rule "terraform_required_version" { | ||
enabled = true | ||
} | ||
|
||
# Ensure that a module complies with the Terraform Standard Module Structure / https://www.terraform.io/docs/modules/index.html#standard-module-structure | ||
rule "terraform_standard_module_structure" { | ||
enabled = true | ||
} | ||
|
||
# Disallow variable declarations without type | ||
rule "terraform_typed_variables" { | ||
enabled = true | ||
} | ||
|
||
# Disallow variables, data sources, and locals that are declared but never used | ||
rule terraform_unused_declarations { | ||
enabled = true | ||
} | ||
|
||
# Check that all required_providers are used in the module | ||
rule terraform_unused_required_providers { | ||
enabled = true | ||
} |
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
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
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,17 @@ | ||
output "result" { | ||
depends_on = [data.local_file.awscli_results_file] | ||
description = "The output of the AWS CLI command, if it can be JSON decoded" | ||
value = try(jsondecode(data.local_file.awscli_results_file.content), "") | ||
} | ||
|
||
output "result_raw" { | ||
depends_on = [data.local_file.awscli_results_file] | ||
description = "The raw, non JSON decoded output of the AWS CLI command" | ||
value = data.local_file.awscli_results_file.content | ||
} | ||
|
||
output "result_was_decoded" { | ||
depends_on = [data.local_file.awscli_results_file] | ||
description = "Can the output from the AWS CLI command can be JSON decoded" | ||
value = can(jsondecode(data.local_file.awscli_results_file.content)) | ||
} |