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

r/aws_appmesh_route: Correctly handle routes with 0 weights #13539

Merged

Conversation

ewbankkit
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13479.

Release note for CHANGELOG:

resource/aws_appmesh_route: Correctly handle routes with `weight = 0`

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAppmesh/Route'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAppmesh/Route -timeout 120m
=== RUN   TestAccAWSAppmesh
=== RUN   TestAccAWSAppmesh/Route
=== RUN   TestAccAWSAppmesh/Route/tags
=== RUN   TestAccAWSAppmesh/Route/httpHeader
=== RUN   TestAccAWSAppmesh/Route/httpRoute
=== RUN   TestAccAWSAppmesh/Route/tcpRoute
=== RUN   TestAccAWSAppmesh/Route/routePriority
=== RUN   TestAccAWSAppmesh/VirtualRouter
=== RUN   TestAccAWSAppmesh/VirtualRouter/basic
=== RUN   TestAccAWSAppmesh/VirtualRouter/tags
--- PASS: TestAccAWSAppmesh (426.83s)
    --- PASS: TestAccAWSAppmesh/Route (316.93s)
        --- PASS: TestAccAWSAppmesh/Route/tags (72.03s)
        --- PASS: TestAccAWSAppmesh/Route/httpHeader (52.14s)
        --- PASS: TestAccAWSAppmesh/Route/httpRoute (70.98s)
        --- PASS: TestAccAWSAppmesh/Route/tcpRoute (71.21s)
        --- PASS: TestAccAWSAppmesh/Route/routePriority (50.55s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (109.90s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/basic (45.47s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/tags (64.43s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	426.884s

without the fix:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAppmesh/Route/httpRoute'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAppmesh/Route/httpRoute -timeout 120m
=== RUN   TestAccAWSAppmesh
=== RUN   TestAccAWSAppmesh/VirtualRouter
=== RUN   TestAccAWSAppmesh/Route
=== RUN   TestAccAWSAppmesh/Route/httpRoute
--- FAIL: TestAccAWSAppmesh (37.51s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (0.00s)
    --- FAIL: TestAccAWSAppmesh/Route (37.51s)
        --- FAIL: TestAccAWSAppmesh/Route/httpRoute (37.51s)
            testing.go:684: Step 2 error: errors during apply:
                
                Error: error updating App Mesh route: InvalidParameter: 1 validation error(s) found.
                - missing required field, UpdateRouteInput.Spec.HttpRoute.Action.WeightedTargets[0].Weight.
                
                
                  on /tmp/tf-test830154970/main.tf line 34:
                  (source code not available)
                
                
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	37.563s
FAIL
GNUmakefile:26: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@ewbankkit ewbankkit requested a review from a team May 28, 2020 16:07
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/appmesh Issues and PRs that pertain to the appmesh service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 28, 2020
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Jun 3, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

LGTM @ewbankkit 👍

Output of acceptance tests:

--- PASS: TestAccAWSAppmesh (1100.07s)
    --- PASS: TestAccAWSAppmesh/VirtualNode (334.61s)
        --- PASS: TestAccAWSAppmesh/VirtualNode/listenerHealthChecks (65.48s)
        --- PASS: TestAccAWSAppmesh/VirtualNode/logging (47.33s)
        --- PASS: TestAccAWSAppmesh/VirtualNode/tags (70.17s)
        --- PASS: TestAccAWSAppmesh/VirtualNode/basic (30.27s)
        --- PASS: TestAccAWSAppmesh/VirtualNode/cloudMapServiceDiscovery (121.36s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (118.50s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/basic (48.19s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/tags (70.31s)
    --- PASS: TestAccAWSAppmesh/VirtualService (180.52s)
        --- PASS: TestAccAWSAppmesh/VirtualService/virtualNode (54.97s)
        --- PASS: TestAccAWSAppmesh/VirtualService/virtualRouter (51.24s)
        --- PASS: TestAccAWSAppmesh/VirtualService/tags (74.32s)
    --- PASS: TestAccAWSAppmesh/Mesh (132.69s)
        --- PASS: TestAccAWSAppmesh/Mesh/basic (24.57s)
        --- PASS: TestAccAWSAppmesh/Mesh/egressFilter (50.79s)
        --- PASS: TestAccAWSAppmesh/Mesh/tags (57.34s)
    --- PASS: TestAccAWSAppmesh/Route (333.74s)
        --- PASS: TestAccAWSAppmesh/Route/tcpRoute (72.82s)
        --- PASS: TestAccAWSAppmesh/Route/routePriority (54.27s)
        --- PASS: TestAccAWSAppmesh/Route/tags (76.09s)
        --- PASS: TestAccAWSAppmesh/Route/httpHeader (55.24s)
        --- PASS: TestAccAWSAppmesh/Route/httpRoute (75.31s)

@anGie44 anGie44 merged commit edff494 into hashicorp:master Jun 4, 2020
@anGie44 anGie44 modified the milestones: Roadmap, v2.65.0 Jun 4, 2020
anGie44 added a commit that referenced this pull request Jun 4, 2020
@ewbankkit ewbankkit deleted the b-appmesh-route-0-weighted-target branch June 4, 2020 12:12
@ghost
Copy link

ghost commented Jun 5, 2020

This has been released in version 2.65.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jul 4, 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 Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/appmesh Issues and PRs that pertain to the appmesh service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of "aws_appmesh_route" fails if one of the "weighted_targets" has "weight = 0"
2 participants