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

New Resource: aws_wafregional_rate_based_rule #3871

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

radeksimko
Copy link
Member

Test results

make testacc TEST=./aws TESTARGS='-run=TestAccAWSWafRegionalRateBasedRule_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSWafRegionalRateBasedRule_ -timeout 120m
=== RUN   TestAccAWSWafRegionalRateBasedRule_basic
--- PASS: TestAccAWSWafRegionalRateBasedRule_basic (48.24s)
=== RUN   TestAccAWSWafRegionalRateBasedRule_changeNameForceNew
--- PASS: TestAccAWSWafRegionalRateBasedRule_changeNameForceNew (91.79s)
=== RUN   TestAccAWSWafRegionalRateBasedRule_disappears
--- PASS: TestAccAWSWafRegionalRateBasedRule_disappears (47.80s)
=== RUN   TestAccAWSWafRegionalRateBasedRule_changePredicates
--- PASS: TestAccAWSWafRegionalRateBasedRule_changePredicates (77.09s)
=== RUN   TestAccAWSWafRegionalRateBasedRule_noPredicates
--- PASS: TestAccAWSWafRegionalRateBasedRule_noPredicates (28.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	293.792s

@radeksimko radeksimko added new-resource Introduces a new resource. service/waf Issues and PRs that pertain to the waf service. labels Mar 22, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 22, 2018
@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from eb7ce71 to 3b58637 Compare March 23, 2018 10:34
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 23, 2018
Copy link
Contributor

@appilon appilon left a 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{}{
Copy link
Contributor

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,
})

Copy link
Member Author

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),
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong destroy check?

Copy link
Member Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong destroy check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot! 🙈

@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from 3b58637 to 6426cc3 Compare March 27, 2018 11:51
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 27, 2018
@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from 6426cc3 to 2800d71 Compare March 27, 2018 12:00
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 27, 2018
@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from 2800d71 to f5b6e38 Compare March 27, 2018 12:04
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 27, 2018
@radeksimko
Copy link
Member Author

@appilon PTAL, I believe I addressed all your feedback.

@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from f5b6e38 to da349d2 Compare March 27, 2018 12:34
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 27, 2018
Copy link
Contributor

@appilon appilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@radeksimko radeksimko force-pushed the f-wafregional-rate-based-rule branch from da349d2 to 34b42c3 Compare March 27, 2018 17:16
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 27, 2018
@radeksimko radeksimko merged commit bc03c6d into master Mar 27, 2018
@radeksimko radeksimko deleted the f-wafregional-rate-based-rule branch March 27, 2018 17:18
@bflad bflad added this to the v1.13.0 milestone Mar 29, 2018
@bflad
Copy link
Contributor

bflad commented Mar 29, 2018

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.

@ghost
Copy link

ghost commented Apr 7, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/waf Issues and PRs that pertain to the waf service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants