-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correctly added test for #207. able to reproduce
- Loading branch information
Showing
6 changed files
with
97 additions
and
22 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
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
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,61 @@ | ||
# PASS with best syntax | ||
resource "aws_redshift_parameter_group" "pass_best" { | ||
name = "foo" | ||
family = "redshift-1.0" | ||
|
||
parameter { | ||
name = "tls" | ||
value = "enabled" | ||
} | ||
parameter { | ||
name = "audit_logs" | ||
value = "enabled" | ||
} | ||
} | ||
|
||
# PASS with Alternate syntax | ||
resource "aws_redshift_parameter_group" "pass_alt" { | ||
name = "bar" | ||
family = "redshift-1.0" | ||
|
||
parameter = | ||
[{ | ||
name = "tls" | ||
value = "enabled" | ||
}, | ||
{ | ||
name = "audit_logs" | ||
value = "enabled" | ||
}] | ||
} | ||
|
||
# FAIL with best syntax | ||
resource "aws_redshift_parameter_group" "fail_best" { | ||
name = "fail_foo" | ||
family = "redshift-1.0" | ||
|
||
parameter { | ||
name = "tls" | ||
value = "disabled" | ||
} | ||
parameter { | ||
name = "audit_logs" | ||
value = "enabled" | ||
} | ||
} | ||
|
||
# FAIL with Alternate syntax | ||
resource "aws_redshift_parameter_group" "fail_alt" { | ||
name = "fail_bar" | ||
family = "redshift-1.0" | ||
|
||
parameter = | ||
[{ | ||
name = "tls" | ||
value = "disabled" | ||
}, | ||
{ | ||
name = "audit_logs" | ||
value = "enabled" | ||
}] | ||
} |
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,26 @@ | ||
--- | ||
version: 1 | ||
description: Terraform v12 rules | ||
type: Terraform12 | ||
files: | ||
- "*.tf" | ||
- "*.tfvars" | ||
rules: | ||
# This test rule is intended to recreate a reported bug, issue 207 | ||
- id: "ATTR_BLOCK" | ||
message: "test: alternate syntax is allowed" | ||
resources: | ||
- aws_redshift_parameter_group | ||
category: resource | ||
severity: FAILURE | ||
assertions: | ||
- some: | ||
key: parameter | ||
expressions: | ||
- and: | ||
- key: name | ||
op: eq | ||
value: tls | ||
- key: value | ||
op: eq | ||
value: enabled |