Skip to content

Commit

Permalink
Add test to check if terraform builtin rules can be except
Browse files Browse the repository at this point in the history
  • Loading branch information
chapipo committed Jun 23, 2020
1 parent fc5f787 commit 3d283e3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ cover-cli:
smoke-test:
@$(BUILD_DIR)/config-lint -terraform cli/testdata/smoketest_tf12.tf
@$(BUILD_DIR)/config-lint -tfparser tf11 -terraform cli/testdata/smoketest_tf11.tf

@$(BUILD_DIR)/config-lint -tfparser tf11 -terraform -profile cli/testdata/profile-exceptions.yml cli/testdata/smoketest_exceptions.tf
16 changes: 16 additions & 0 deletions cli/testdata/profile-exceptions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

terraform: true

files:
- "*.tf"

exceptions:
- RuleID: IAM_ROLE_WILDCARD_ACTION
ResourceCategory: resource
ResourceType: aws_iam_role
ResourceID: role2
Comments: Just because

tags:
- iam
19 changes: 19 additions & 0 deletions cli/testdata/smoketest_exceptions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "aws_iam_role" "role2" {
name = "role2"

assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "*",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}

0 comments on commit 3d283e3

Please sign in to comment.