-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New Resource: aws_wafregional_rate_based_rule #3871
Conversation
eb7ce71
to
3b58637
Compare
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.
I could be mistaken but I think a few of the acceptance tests are using the wrong destroy check
var predicates []map[string]interface{} | ||
|
||
for _, predicateSet := range resp.Rule.MatchPredicates { | ||
predicate := map[string]interface{}{ |
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.
I don't know if I can argue it's better but you could avoid the predicate
variable
predicates = append(predicates, map[string]interface{}{
"negated": *predicateSet.Negated,
"type": *predicateSet.Type,
"data_id": *predicateSet.DataId,
})
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.
That's a valid argument 👍 I will address that.
req := &waf.UpdateRateBasedRuleInput{ | ||
ChangeToken: token, | ||
RuleId: aws.String(id), | ||
Updates: diffWafRulePredicates(oldP, newP), |
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.
I suggest maybe moving diffWafRulePredicates
's definition to waf_helpers.go
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckAWSWafIPSetDestroy, |
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.
wrong destroy check?
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.
Good spot! 🙈
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckAWSWafRuleDestroy, |
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.
wrong destroy check?
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.
Good spot! 🙈
3b58637
to
6426cc3
Compare
6426cc3
to
2800d71
Compare
2800d71
to
f5b6e38
Compare
@appilon PTAL, I believe I addressed all your feedback. |
f5b6e38
to
da349d2
Compare
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.
LGTM!
da349d2
to
34b42c3
Compare
This has been released in version 1.13.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Test results