Skip to content

Commit

Permalink
Updates tflint for website and acceptance test validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Sep 15, 2021
1 parent d39b8c7 commit 122c597
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/acctest-terraform-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- .github/workflows/acctest-terraform-lint.yml
- .go-version
- .tflint.hcl
- aws/*_test.go
- scripts/validate-terraform.sh
- tools/go.mod
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd tools && go install github.com/katbyte/terrafmt
- run: cd tools && go install github.com/terraform-linters/tflint
- run: tflint --init
- run: |
# resource_aws_ecs_capacity_provider_test.go: two format verbs on one line (%[2]q = %[3]q). https://github.com/katbyte/terrafmt/issues/46
# resource_aws_efs_file_system_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- .go-version
- .markdownlinkcheck.json
- .markdownlint.yml
- .tflint.hcl
- website/docs/**
- tools/go.mod

Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd tools && go install github.com/katbyte/terrafmt
- run: cd tools && go install github.com/terraform-linters/tflint
- run: tflint --init
- run: |
exit_code=0
Expand All @@ -106,9 +108,10 @@ jobs:
shared_rules=(
"--enable-rule=terraform_comment_syntax"
"--disable-rule=aws_cloudwatch_event_target_invalid_arn"
"--disable-rule=aws_cognito_user_pool_domain_invalid_domain"
"--disable-rule=aws_db_instance_default_parameter_group"
"--disable-rule=aws_elasticache_cluster_default_parameter_group"
"--disable-rule=aws_elasticache_replication_group_default_parameter_group"
"--disable-rule=aws_iam_policy_sid_invalid_characters"
"--disable-rule=aws_iam_saml_provider_invalid_saml_metadata_document"
"--disable-rule=aws_iam_server_certificate_invalid_certificate_body"
"--disable-rule=aws_iam_server_certificate_invalid_private_key"
Expand Down
2 changes: 2 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugin "aws" {
enabled = true
version = "0.7.1"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
5 changes: 1 addition & 4 deletions website/docs/r/api_gateway_integration.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ resource "aws_lambda_function" "lambda" {
function_name = "mylambda"
role = aws_iam_role.role.arn
handler = "lambda.lambda_handler"
runtime = "python2.7"
runtime = "python3.6"
# The filebase64sha256() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
# source_code_hash = "${base64sha256(file("lambda.zip"))}"
source_code_hash = filebase64sha256("lambda.zip")
}
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/lambda_permission.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "aws_lambda_function" "func" {
function_name = "lambda_called_from_sns"
role = aws_iam_role.default.arn
handler = "exports.handler"
runtime = "python2.7"
runtime = "python3.6"
}
resource "aws_iam_role" "default" {
Expand Down Expand Up @@ -155,7 +155,7 @@ resource "aws_lambda_function" "logging" {
function_name = "lambda_called_from_cloudwatch_logs"
handler = "exports.handler"
role = aws_iam_role.default.arn
runtime = "python2.7"
runtime = "python3.6"
}
resource "aws_iam_role" "default" {
Expand Down

0 comments on commit 122c597

Please sign in to comment.