From dd32b9a7844c6f4dee7956e5d715b21798aedfd2 Mon Sep 17 00:00:00 2001 From: John Hanrahan Date: Wed, 11 Aug 2021 11:44:58 -0700 Subject: [PATCH] fix some documentation, add default --- docs/resources/site_rule.md | 9 ++++++--- provider/resource_site_rule.go | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/resources/site_rule.md b/docs/resources/site_rule.md index a537079..e8d53d3 100644 --- a/docs/resources/site_rule.md +++ b/docs/resources/site_rule.md @@ -40,7 +40,7 @@ resource "sigsci_site_rule" "test" { ### Argument Reference - `site_short_names` - (Required) Sites with the rule available. Rules with a global corpScope will return '[]'. - - `type` Type of rule (request, signal, multival, templatedSignal). + - `type` Type of rule (request, signal, multival, templatedSignal). - `enabled` - (Required) enabled or disabled - `group_operator` - Conditions that must be matched when evaluating the request (all, any) - `signal` - The signal id of the signal being excluded or tagged. Only used for type=signal @@ -54,9 +54,12 @@ resource "sigsci_site_rule" "test" { - `value` - type: single - See request fields (https://docs.signalsciences.net/using-signal-sciences/features/rules/#request-fields) - `conditions` - Conditions on which this condition should trigger. Can recursively add this 3 deep. - `actions` - Action to take when triggered - - `type` - (block, allow, excludeSignal) + - `type` - (block, allow, excludeSignal, addSignal). A RateLimit rule has valid values of (logRequest, blockSignal) - `signal` - id of signal to be tagged with or excluded - + - `rate_limit` - Enable rate limiting on this rule + - `threshold` - Number of requests to count before rate limiting is activated + - `interval` - Length of time in minutes the threshold should be measured for (default: 1, options: 1, 5, 10) + - `duration` - Length of time in seconds to enforce the rule for once activated (default: 600, minimum: 300, maximum: 3600) ### Attributes Reference In addition to all arguments, the following fields are also available - `id` - the identifier of the resource diff --git a/provider/resource_site_rule.go b/provider/resource_site_rule.go index c478f7f..32d245a 100644 --- a/provider/resource_site_rule.go +++ b/provider/resource_site_rule.go @@ -54,7 +54,7 @@ func resourceSiteRule() *schema.Resource { Schema: map[string]*schema.Schema{ "type": { Type: schema.TypeString, - Description: "(block, allow, exclude) (rateLimit rule valid values: logRequest, blockSignal)", + Description: "(block, allow, excludeSignal, addSignal) (rateLimit rule valid values: logRequest, blockSignal)", Required: true, ForceNew: true, }, @@ -193,6 +193,7 @@ func resourceSiteRule() *schema.Resource { "duration": { Type: schema.TypeInt, Description: "duration in seconds (300 < x < 3600)", + Default: 600, Required: true, }, },