-
-
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
Conversation
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This should be added to the description
/terratest |
for_each = length(lookup(scope_down_statement.value, "and", [])) > 0 ? [scope_down_statement.value.and] : [] | ||
content { | ||
dynamic "statement" { | ||
for_each = and_statement.value |
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
for_each = length(lookup(scope_down_statement.value, "and", [])) > 0 ? [scope_down_statement.value.and] : []
content {
dynamic "statement" {
for_each = and_statement.value
Looks like scope_down_statement.value.and
should be a list b/c you check its length
.
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.
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 thanks for the PR, please see comments
💥 This pull request now has conflicts. Could you fix it @GuusDeGraeve? 🙏 |
This PR was closed due to inactivity and merge conflicts. 😭 |
what
scope_down_statement
(including and statements) inrate_based_statement_rules
custom_response
inrate_based_statement_rules
block actionevaluation_window_sec
inrate_based_statement_rules
why
references
closes #63