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/lb_listener_rule - add validations + tagging support #19285

Merged
merged 7 commits into from
May 10, 2021

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented May 8, 2021

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

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSLBListenerRule_'
--- PASS: TestAccAWSLBListenerRule_basic (217.74s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (217.97s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (219.85s)
--- PASS: TestAccAWSLBListenerRule_oidc (214.04s)
--- PASS: TestAccAWSLBListenerRule_Action_Order (224.32s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (275.69s)
--- PASS: TestAccAWSLBListenerRule_cognito (220.86s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (275.04s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (0.77s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (224.27s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (222.08s)
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (43.74s)
--- PASS: TestAccAWSLBListenerRule_priority (646.91s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (215.49s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (220.60s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (280.89s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (224.28s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (212.58s)
--- PASS: TestAccAWSLBListenerRule_BackwardsCompatibility (211.23s)
--- PASS: TestAccAWSLBListenerRule_forwardWeighted (367.69s)
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (239.57s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (342.25s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (291.23s)
--- PASS: TestAccAWSLBListenerRule_redirect (294.27s)
--- PASS: TestAccAWSLBListenerRule_tags (406.13s)

@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/elbv2 Issues and PRs that pertain to the elbv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 8, 2021
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels May 8, 2021
@DrFaust92 DrFaust92 marked this pull request as ready for review May 8, 2021 22:04
@DrFaust92 DrFaust92 requested a review from a team as a code owner May 8, 2021 22:04
@ghost ghost added the documentation Introduces or discusses updates to documentation. label May 8, 2021
@ewbankkit ewbankkit self-assigned this May 10, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSLBListenerRule_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSLBListenerRule_ -timeout 180m
=== RUN   TestAccAWSLBListenerRule_basic
=== PAUSE TestAccAWSLBListenerRule_basic
=== RUN   TestAccAWSLBListenerRule_tags
=== PAUSE TestAccAWSLBListenerRule_tags
=== RUN   TestAccAWSLBListenerRule_forwardWeighted
=== PAUSE TestAccAWSLBListenerRule_forwardWeighted
=== RUN   TestAccAWSLBListenerRule_BackwardsCompatibility
=== PAUSE TestAccAWSLBListenerRule_BackwardsCompatibility
=== RUN   TestAccAWSLBListenerRule_redirect
=== PAUSE TestAccAWSLBListenerRule_redirect
=== RUN   TestAccAWSLBListenerRule_fixedResponse
=== PAUSE TestAccAWSLBListenerRule_fixedResponse
=== RUN   TestAccAWSLBListenerRule_updateFixedResponse
=== PAUSE TestAccAWSLBListenerRule_updateFixedResponse
=== RUN   TestAccAWSLBListenerRule_updateRulePriority
=== PAUSE TestAccAWSLBListenerRule_updateRulePriority
=== RUN   TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
=== PAUSE TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
=== RUN   TestAccAWSLBListenerRule_priority
=== PAUSE TestAccAWSLBListenerRule_priority
=== RUN   TestAccAWSLBListenerRule_cognito
=== PAUSE TestAccAWSLBListenerRule_cognito
=== RUN   TestAccAWSLBListenerRule_oidc
=== PAUSE TestAccAWSLBListenerRule_oidc
=== RUN   TestAccAWSLBListenerRule_Action_Order
=== PAUSE TestAccAWSLBListenerRule_Action_Order
=== RUN   TestAccAWSLBListenerRule_Action_Order_Recreates
=== PAUSE TestAccAWSLBListenerRule_Action_Order_Recreates
=== RUN   TestAccAWSLBListenerRule_conditionAttributesCount
=== PAUSE TestAccAWSLBListenerRule_conditionAttributesCount
=== RUN   TestAccAWSLBListenerRule_conditionHostHeader
=== PAUSE TestAccAWSLBListenerRule_conditionHostHeader
=== RUN   TestAccAWSLBListenerRule_conditionHttpHeader
=== PAUSE TestAccAWSLBListenerRule_conditionHttpHeader
=== RUN   TestAccAWSLBListenerRule_conditionHttpHeader_invalid
=== PAUSE TestAccAWSLBListenerRule_conditionHttpHeader_invalid
=== RUN   TestAccAWSLBListenerRule_conditionHttpRequestMethod
=== PAUSE TestAccAWSLBListenerRule_conditionHttpRequestMethod
=== RUN   TestAccAWSLBListenerRule_conditionPathPattern
=== PAUSE TestAccAWSLBListenerRule_conditionPathPattern
=== RUN   TestAccAWSLBListenerRule_conditionQueryString
=== PAUSE TestAccAWSLBListenerRule_conditionQueryString
=== RUN   TestAccAWSLBListenerRule_conditionSourceIp
=== PAUSE TestAccAWSLBListenerRule_conditionSourceIp
=== RUN   TestAccAWSLBListenerRule_conditionUpdateMixed
=== PAUSE TestAccAWSLBListenerRule_conditionUpdateMixed
=== RUN   TestAccAWSLBListenerRule_conditionMultiple
=== PAUSE TestAccAWSLBListenerRule_conditionMultiple
=== RUN   TestAccAWSLBListenerRule_conditionUpdateMultiple
=== PAUSE TestAccAWSLBListenerRule_conditionUpdateMultiple
=== CONT  TestAccAWSLBListenerRule_basic
=== CONT  TestAccAWSLBListenerRule_Action_Order_Recreates
=== CONT  TestAccAWSLBListenerRule_conditionUpdateMultiple
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (228.95s)
=== CONT  TestAccAWSLBListenerRule_conditionMultiple
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (241.32s)
=== CONT  TestAccAWSLBListenerRule_conditionUpdateMixed
--- PASS: TestAccAWSLBListenerRule_basic (291.44s)
=== CONT  TestAccAWSLBListenerRule_conditionSourceIp
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (208.39s)
=== CONT  TestAccAWSLBListenerRule_conditionQueryString
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (230.16s)
=== CONT  TestAccAWSLBListenerRule_conditionPathPattern
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (284.81s)
=== CONT  TestAccAWSLBListenerRule_conditionHttpRequestMethod
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (217.45s)
=== CONT  TestAccAWSLBListenerRule_conditionHttpHeader_invalid
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (0.77s)
=== CONT  TestAccAWSLBListenerRule_conditionHttpHeader
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (239.16s)
=== CONT  TestAccAWSLBListenerRule_conditionHostHeader
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (248.91s)
=== CONT  TestAccAWSLBListenerRule_conditionAttributesCount
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (16.39s)
=== CONT  TestAccAWSLBListenerRule_updateRulePriority
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (238.42s)
=== CONT  TestAccAWSLBListenerRule_Action_Order
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (231.09s)
=== CONT  TestAccAWSLBListenerRule_oidc
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (232.84s)
=== CONT  TestAccAWSLBListenerRule_cognito
--- PASS: TestAccAWSLBListenerRule_Action_Order (209.47s)
=== CONT  TestAccAWSLBListenerRule_priority
--- PASS: TestAccAWSLBListenerRule_oidc (208.80s)
=== CONT  TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
--- PASS: TestAccAWSLBListenerRule_cognito (227.82s)
=== CONT  TestAccAWSLBListenerRule_redirect
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (242.85s)
=== CONT  TestAccAWSLBListenerRule_updateFixedResponse
--- PASS: TestAccAWSLBListenerRule_redirect (238.79s)
=== CONT  TestAccAWSLBListenerRule_fixedResponse
--- PASS: TestAccAWSLBListenerRule_priority (413.69s)
=== CONT  TestAccAWSLBListenerRule_forwardWeighted
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (251.91s)
=== CONT  TestAccAWSLBListenerRule_BackwardsCompatibility
--- PASS: TestAccAWSLBListenerRule_fixedResponse (219.12s)
=== CONT  TestAccAWSLBListenerRule_tags
--- PASS: TestAccAWSLBListenerRule_forwardWeighted (275.54s)
--- PASS: TestAccAWSLBListenerRule_BackwardsCompatibility (207.20s)
--- PASS: TestAccAWSLBListenerRule_tags (243.09s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1956.733s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSLBListenerRule_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLBListenerRule_ -timeout 180m
=== RUN   TestAccAWSLBListenerRule_basic
=== PAUSE TestAccAWSLBListenerRule_basic
=== RUN   TestAccAWSLBListenerRule_tags
=== PAUSE TestAccAWSLBListenerRule_tags
=== RUN   TestAccAWSLBListenerRule_forwardWeighted
=== PAUSE TestAccAWSLBListenerRule_forwardWeighted
=== RUN   TestAccAWSLBListenerRule_BackwardsCompatibility
=== PAUSE TestAccAWSLBListenerRule_BackwardsCompatibility
=== RUN   TestAccAWSLBListenerRule_redirect
=== PAUSE TestAccAWSLBListenerRule_redirect
=== RUN   TestAccAWSLBListenerRule_fixedResponse
=== PAUSE TestAccAWSLBListenerRule_fixedResponse
=== RUN   TestAccAWSLBListenerRule_updateFixedResponse
=== PAUSE TestAccAWSLBListenerRule_updateFixedResponse
=== RUN   TestAccAWSLBListenerRule_updateRulePriority
=== PAUSE TestAccAWSLBListenerRule_updateRulePriority
=== RUN   TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
=== PAUSE TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
=== RUN   TestAccAWSLBListenerRule_priority
=== PAUSE TestAccAWSLBListenerRule_priority
=== RUN   TestAccAWSLBListenerRule_cognito
=== PAUSE TestAccAWSLBListenerRule_cognito
=== RUN   TestAccAWSLBListenerRule_oidc
=== PAUSE TestAccAWSLBListenerRule_oidc
=== RUN   TestAccAWSLBListenerRule_Action_Order
=== PAUSE TestAccAWSLBListenerRule_Action_Order
=== RUN   TestAccAWSLBListenerRule_Action_Order_Recreates
=== PAUSE TestAccAWSLBListenerRule_Action_Order_Recreates
=== RUN   TestAccAWSLBListenerRule_conditionAttributesCount
=== PAUSE TestAccAWSLBListenerRule_conditionAttributesCount
=== RUN   TestAccAWSLBListenerRule_conditionHostHeader
=== PAUSE TestAccAWSLBListenerRule_conditionHostHeader
=== RUN   TestAccAWSLBListenerRule_conditionHttpHeader
=== PAUSE TestAccAWSLBListenerRule_conditionHttpHeader
=== RUN   TestAccAWSLBListenerRule_conditionHttpHeader_invalid
=== PAUSE TestAccAWSLBListenerRule_conditionHttpHeader_invalid
=== RUN   TestAccAWSLBListenerRule_conditionHttpRequestMethod
=== PAUSE TestAccAWSLBListenerRule_conditionHttpRequestMethod
=== RUN   TestAccAWSLBListenerRule_conditionPathPattern
=== PAUSE TestAccAWSLBListenerRule_conditionPathPattern
=== RUN   TestAccAWSLBListenerRule_conditionQueryString
=== PAUSE TestAccAWSLBListenerRule_conditionQueryString
=== RUN   TestAccAWSLBListenerRule_conditionSourceIp
=== PAUSE TestAccAWSLBListenerRule_conditionSourceIp
=== RUN   TestAccAWSLBListenerRule_conditionUpdateMixed
=== PAUSE TestAccAWSLBListenerRule_conditionUpdateMixed
=== RUN   TestAccAWSLBListenerRule_conditionMultiple
=== PAUSE TestAccAWSLBListenerRule_conditionMultiple
=== RUN   TestAccAWSLBListenerRule_conditionUpdateMultiple
=== PAUSE TestAccAWSLBListenerRule_conditionUpdateMultiple
=== CONT  TestAccAWSLBListenerRule_basic
=== CONT  TestAccAWSLBListenerRule_Action_Order_Recreates
=== CONT  TestAccAWSLBListenerRule_conditionUpdateMultiple
=== CONT  TestAccAWSLBListenerRule_conditionMultiple
=== CONT  TestAccAWSLBListenerRule_conditionPathPattern
=== CONT  TestAccAWSLBListenerRule_conditionHttpHeader_invalid
=== CONT  TestAccAWSLBListenerRule_conditionHttpRequestMethod
=== CONT  TestAccAWSLBListenerRule_conditionAttributesCount
=== CONT  TestAccAWSLBListenerRule_priority
=== CONT  TestAccAWSLBListenerRule_conditionUpdateMixed
=== CONT  TestAccAWSLBListenerRule_conditionSourceIp
=== CONT  TestAccAWSLBListenerRule_conditionQueryString
=== CONT  TestAccAWSLBListenerRule_conditionHttpHeader
=== CONT  TestAccAWSLBListenerRule_conditionHostHeader
=== CONT  TestAccAWSLBListenerRule_cognito
=== CONT  TestAccAWSLBListenerRule_updateRulePriority
=== CONT  TestAccAWSLBListenerRule_Action_Order
=== CONT  TestAccAWSLBListenerRule_oidc
=== CONT  TestAccAWSLBListenerRule_forwardWeighted
=== CONT  TestAccAWSLBListenerRule_updateFixedResponse
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (6.06s)
=== CONT  TestAccAWSLBListenerRule_BackwardsCompatibility
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (37.06s)
=== CONT  TestAccAWSLBListenerRule_fixedResponse
=== RUN   TestAccAWSLBListenerRule_cognito
    resource_aws_lb_listener_rule_test.go:521: LB Listener Rule action type 'authenticate-cognito' type is not supported in GovCloud partition
--- SKIP: TestAccAWSLBListenerRule_cognito (0.00s)
=== CONT  TestAccAWSLBListenerRule_tags
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (180.93s)
=== CONT  TestAccAWSLBListenerRule_redirect
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (193.24s)
=== CONT  TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew
--- PASS: TestAccAWSLBListenerRule_Action_Order (198.57s)
--- PASS: TestAccAWSLBListenerRule_oidc (200.60s)
--- PASS: TestAccAWSLBListenerRule_basic (201.20s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (203.08s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (207.32s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (214.90s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (180.28s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (226.74s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (235.66s)
--- PASS: TestAccAWSLBListenerRule_BackwardsCompatibility (231.47s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (241.74s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (241.76s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (243.76s)
--- PASS: TestAccAWSLBListenerRule_forwardWeighted (260.92s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (265.04s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (266.60s)
--- PASS: TestAccAWSLBListenerRule_redirect (166.37s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (210.83s)
--- PASS: TestAccAWSLBListenerRule_tags (247.26s)
--- PASS: TestAccAWSLBListenerRule_priority (442.39s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	446.018s

@ewbankkit ewbankkit merged commit 4e27c2f into hashicorp:main May 10, 2021
@github-actions github-actions bot added this to the v3.40.0 milestone May 10, 2021
@ghost
Copy link

ghost commented May 13, 2021

This has been released in version 3.40.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!

@alext
Copy link
Contributor

alext commented May 14, 2021

With these changes it's no longer possible to override the default redirect values with blank. e.g. I'm using the following config with a blank query parameter to override the default value of "#{query}" as I don't want the query string to be preserved when redirecting. This was worked before this change, but now triggers a validation error

resource "aws_lb_listener_rule" "bare_domain_redirect" {
  listener_arn = aws_lb_listener.example.arn

  action {
    type = "redirect"

    redirect {
      protocol    = "HTTPS"
      host        = "www.example.com"
      port        = 443
      path        = "/"
      query       = ""
      status_code = "HTTP_301"
    }
  }

  condition {
    host_header {
      values = [var.external_domain_name]
    }
  }
}

@ewbankkit
Copy link
Contributor

@alext Thanks for noticing this 👏.
Please open an issue linking to this PR.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2021
@DrFaust92 DrFaust92 deleted the r/lb_listener_tags branch June 14, 2021 04:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/XL 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.

3 participants