generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: extend support for rate based statement rules #81
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
628f50a
add support for custom response code + scope down statement in rate_b…
GuusDeGraeve 98cae86
default to null
GuusDeGraeve e628f95
support positional_constraint + make byte_match_statement dynamic
GuusDeGraeve 7fefb7d
support for text transformation
GuusDeGraeve b5f561b
add missing statement block
GuusDeGraeve c9826d7
fix scope_down_statement
GuusDeGraeve 77e3585
Merge branch 'main' into main
GuusDeGraeve 5d869fb
fix linting
GuusDeGraeve 06baf4c
allow for single byte_match_statement
GuusDeGraeve 94081ac
Merge branch 'main' into main
aknysh bebf6c1
add to variables description
GuusDeGraeve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -499,8 +499,9 @@ variable "rate_based_statement_rules" { | |
immunity_time = number | ||
}) | ||
}), null) | ||
rule_label = optional(list(string), null) | ||
statement = any | ||
rule_label = optional(list(string), null) | ||
statement = any | ||
custom_response_code = optional(number, null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be added to the description |
||
visibility_config = optional(object({ | ||
cloudwatch_metrics_enabled = optional(bool) | ||
metric_name = string | ||
|
@@ -545,6 +546,10 @@ variable "rate_based_statement_rules" { | |
Possible values: `MATCH`, `NO_MATCH` | ||
header_name: | ||
The name of the HTTP header to use for the IP address. | ||
|
||
custom_response_code: | ||
The HTTP status code to return when the request is blocked. | ||
For example, `403`, or more applicable to rate based rules, `429`. | ||
|
||
visibility_config: | ||
Defines and enables Amazon CloudWatch metrics and web request sample collection. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuusDeGraeve the PR looks good, thank you.
Some questions about this code
Looks like
scope_down_statement.value.and
should be a list b/c you check itslength
.But then you put it into another list in
[scope_down_statement.value.and]
.Should it be just
? scope_down_statement.value.and : []
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aknysh, yes that is correct, the reason is because the add statement is a list of multiple statements. Which we loop over within the next dynamic block
dynamic "statement" {
.I know it looks quite confusing when reading the code, but it is definitely on purpose.