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_geo_match_set #3915

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

radeksimko
Copy link
Member

Test results

TF_ACC=1 go test ./aws -v -run=TestAccAWSWafRegionalGeoMatchSet_ -timeout 120m
=== RUN   TestAccAWSWafRegionalGeoMatchSet_basic
--- PASS: TestAccAWSWafRegionalGeoMatchSet_basic (40.38s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_changeNameForceNew
--- PASS: TestAccAWSWafRegionalGeoMatchSet_changeNameForceNew (65.81s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_disappears
--- PASS: TestAccAWSWafRegionalGeoMatchSet_disappears (30.67s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_changeConstraints
--- PASS: TestAccAWSWafRegionalGeoMatchSet_changeConstraints (67.57s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_noConstraints
--- PASS: TestAccAWSWafRegionalGeoMatchSet_noConstraints (31.64s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	236.116s

@radeksimko radeksimko added new-resource Introduces a new resource. service/waf Issues and PRs that pertain to the waf service. labels Mar 26, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Mar 26, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

LGTM with a few minor items below for consideration 👍

Delete: resourceAwsWafRegionalGeoMatchSetDelete,

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick: Extraneous &schema.Schema here and below


resp, err := conn.GetGeoMatchSet(params)
if err != nil {
if isAWSErr(err, "WAFNonexistentItemException", "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar note here as other PR about upstream SDK issue.

Also, minor duplicate WAF WAF in the error below. (Aside: I kind of wonder if we should have some sort of FriendlyName attribute on resources)

Copy link
Member Author

Choose a reason for hiding this comment

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

I kind of wonder if we should have some sort of FriendlyName attribute on resources

It sounds like the time is coming to reopen discussion around hashicorp/terraform#13582 😄

{
Config: testAccAWSWafRegionalGeoMatchSetConfigChangeName(geoMatchSetNewName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSWafRegionalGeoMatchSetExists("aws_wafregional_geo_match_set.test", &after),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect an acceptance test here that compares &before to &after (via ID or however necessary)

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.

small suggestion of moving some common funcs to waf_helpers.go

}

d.Set("name", resp.GeoMatchSet.Name)
d.Set("geo_match_constraint", flattenWafGeoMatchConstraint(resp.GeoMatchSet.GeoMatchConstraints))
Copy link
Contributor

Choose a reason for hiding this comment

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

consider moving flattening func to waf_helpers.go

req := &waf.UpdateGeoMatchSetInput{
ChangeToken: token,
GeoMatchSetId: aws.String(id),
Updates: diffWafGeoMatchSetConstraints(oldConstraints, newConstraints),
Copy link
Contributor

Choose a reason for hiding this comment

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

consider moving diff func to waf_helpers.go

@radeksimko radeksimko force-pushed the f-wafregional-geo-match-set branch from 915b514 to 4c6be4f Compare March 27, 2018 11:29
@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-geo-match-set branch from 4c6be4f to 48ba898 Compare March 27, 2018 11:31
@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-geo-match-set branch from 48ba898 to f65ae94 Compare March 27, 2018 11:37
@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

Addressed all your feedback and reran acceptance tests:

=== RUN   TestAccAWSWafRegionalGeoMatchSet_basic
--- PASS: TestAccAWSWafRegionalGeoMatchSet_basic (37.84s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_changeNameForceNew
--- PASS: TestAccAWSWafRegionalGeoMatchSet_changeNameForceNew (105.75s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_disappears
--- PASS: TestAccAWSWafRegionalGeoMatchSet_disappears (30.65s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_changeConstraints
--- PASS: TestAccAWSWafRegionalGeoMatchSet_changeConstraints (68.88s)
=== RUN   TestAccAWSWafRegionalGeoMatchSet_noConstraints
--- PASS: TestAccAWSWafRegionalGeoMatchSet_noConstraints (34.05s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	277.202s

@radeksimko radeksimko merged commit 2e595bf into master Mar 27, 2018
@radeksimko radeksimko deleted the f-wafregional-geo-match-set branch March 27, 2018 11:45
@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.

None yet

3 participants