Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_wafregional_rule: Validate all predicate types #4046

Merged
merged 1 commit into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions aws/resource_aws_wafregional_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ func resourceAwsWafRegionalRule() *schema.Resource {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
"IPMatch",
"ByteMatch",
"SqlInjectionMatch",
"SizeConstraint",
"XssMatch",
wafregional.PredicateTypeByteMatch,
wafregional.PredicateTypeGeoMatch,
wafregional.PredicateTypeIpmatch,
wafregional.PredicateTypeRegexMatch,
wafregional.PredicateTypeSizeConstraint,
wafregional.PredicateTypeSqlInjectionMatch,
wafregional.PredicateTypeXssMatch,
}, false),
},
},
Expand Down
12 changes: 6 additions & 6 deletions website/docs/r/wafregional_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
Provides an AWS WAF Regional rule resource for use with ALB.
---

# aws\_wafregional\_rule
# aws_wafregional_rule

Provides an WAF Regional Rule Resource for use with Application Load Balancer.

Expand All @@ -15,7 +15,7 @@ Provides an WAF Regional Rule Resource for use with Application Load Balancer.
```hcl
resource "aws_wafregional_ipset" "ipset" {
name = "tfIPSet"

ip_set_descriptor {
type = "IPV4"
value = "192.0.7.0/24"
Expand All @@ -25,7 +25,7 @@ resource "aws_wafregional_ipset" "ipset" {
resource "aws_wafregional_rule" "wafrule" {
name = "tfWAFRule"
metric_name = "tfWAFRule"

predicate {
type = "IPMatch"
data_id = "${aws_wafregional_ipset.ipset.id}"
Expand All @@ -40,7 +40,7 @@ The following arguments are supported:

* `name` - (Required) The name or description of the rule.
* `metric_name` - (Required) The name or description for the Amazon CloudWatch metric of this rule.
* `predicate` - (Optional) The `ByteMatchSet`, `IPSet`, `SizeConstraintSet`, `SqlInjectionMatchSet`, or `XssMatchSet` objects to include in a rule.
* `predicate` - (Optional) The objects to include in a rule.

## Nested Fields

Expand All @@ -50,9 +50,9 @@ See [docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-pr

#### Arguments

* `type` - (Required) The type of predicate in a rule, such as an IPSet (IPMatch)
* `type` - (Required) The type of predicate in a rule. Valid values: `ByteMatch`, `GeoMatch`, `IPMatch`, `RegexMatch`, `SizeConstraint`, `SqlInjectionMatch`, or `XssMatch`
* `data_id` - (Required) The unique identifier of a predicate, such as the ID of a `ByteMatchSet` or `IPSet`.
* `negated` - (Required) Whether to use the settings or the negated settings that you specified in the `ByteMatchSet`, `IPSet`, `SizeConstraintSet`, `SqlInjectionMatchSet`, or `XssMatchSet` objects.
* `negated` - (Required) Whether to use the settings or the negated settings that you specified in the objects.

## Remarks

Expand Down