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

Dont recreate listener rule after priority change #23768

Merged

Conversation

m-eitan
Copy link
Contributor

@m-eitan m-eitan commented Mar 20, 2022

Dont recreate listener rule after priority change

It is possible to update the priority without recreating the rule, which is preferred of course. See docs.

Release Notes:

resource/aws_alb_listener_rule: Don't force recreate listener rule on priority change. 

Acceptance Tests:

$ make testacc TESTS=.+updateRulePriority PKG=elbv2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elbv2/... -v -count 1 -parallel 20 -run='.+updateRulePriority'  -timeout 180m
=== RUN   TestAccELBV2ListenerRule_updateRulePriority
=== PAUSE TestAccELBV2ListenerRule_updateRulePriority
=== CONT  TestAccELBV2ListenerRule_updateRulePriority
--- PASS: TestAccELBV2ListenerRule_updateRulePriority (259.10s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elbv2      259.164s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/elbv2 Issues and PRs that pertain to the elbv2 service. labels Mar 20, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @m-eitan 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@bschaatsbergen
Copy link
Member

Can you please run the acceptance tests and add them to the body of the PR description.

@m-eitan
Copy link
Contributor Author

m-eitan commented Mar 21, 2022

Can you please run the acceptance tests and add them to the body of the PR description.

Updated 👍

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 21, 2022
@m-eitan
Copy link
Contributor Author

m-eitan commented Apr 7, 2022

Any update regarding this PR? @bschaatsbergen @justinretzolk

@justinretzolk
Copy link
Member

Hey @m-eitan 👋 Thank you for checking in on this, and for your contribution! Unfortunately, I'm not able to provide an estimate on when this will be merged due to the potential of shifting priorities (we prioritize work by count of ":+1:" reactions, as well as a few other things). A larger prioritization document is in the works, but in the meantime additional information may be found in the FAQ.

@m-eitan
Copy link
Contributor Author

m-eitan commented Apr 10, 2022

@justinretzolk Understood, thank you

@m-eitan
Copy link
Contributor Author

m-eitan commented May 3, 2022

@justinretzolk I would really appreciate if you can take a look again, there are already 6 upvotes and it's a really small change but very important for us to be able to re-order listener rules without downtime using the provider

@bschaatsbergen
Copy link
Member

Hi @m-eitan, I can take a look at this PR in the coming 2 days. I'll need some time to dive into it locally and see why it currently is being forced to recreate. Meanwhile, thanks for your contribution 👍

@bschaatsbergen
Copy link
Member

Seems perfectly possible 👍

Terraform will perform the following actions:

  # aws_lb_listener_rule.non_static will be updated in-place
  ~ resource "aws_lb_listener_rule" "non_static" {
        id           = "arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/63bdb0bc028425c1"
      ~ priority     = 104 -> 101
        tags         = {}
        # (3 unchanged attributes hidden)


        # (3 unchanged blocks hidden)
    }

  # aws_lb_listener_rule.static will be updated in-place
  ~ resource "aws_lb_listener_rule" "static" {
        id           = "arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/4b79897a3bafe9f0"
      ~ priority     = 110 -> 100
        tags         = {}
        # (3 unchanged attributes hidden)


        # (3 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.
aws_lb_listener_rule.non_static: Modifying... [id=arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/63bdb0bc028425c1]
aws_lb_listener_rule.static: Modifying... [id=arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/4b79897a3bafe9f0]
aws_lb_listener_rule.non_static: Modifications complete after 1s [id=arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/63bdb0bc028425c1]
aws_lb_listener_rule.static: Modifications complete after 1s [id=arn:aws:elasticloadbalancing:eu-central-1:822224938642:listener-rule/app/test-lb-tf/420e0d31f1b15ac1/7feed816395e01ae/4b79897a3bafe9f0]

Apply complete! Resources: 0 added, 2 changed, 0 destroyed.

@bschaatsbergen
Copy link
Member

bschaatsbergen commented May 5, 2022

1 comment before we can get this approved and merged:

  • Please create an entry in the .changelog directory using 23768.txt as the filename.

Once ☝️ is done I'll ask one of the internal folks to sign of the PR.


Test (TestAccELBV2ListenerRule_updateRulePriority) seems to pass too 👍

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elbv2/... -v -count 1 -parallel 20 -run='TestAccELBV2ListenerRule_updateRulePriority'  -timeout 180m
=== RUN   TestAccELBV2ListenerRule_updateRulePriority
=== PAUSE TestAccELBV2ListenerRule_updateRulePriority
=== CONT  TestAccELBV2ListenerRule_updateRulePriority
--- PASS: TestAccELBV2ListenerRule_updateRulePriority (278.91s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elbv2      278.944s

@m-eitan
Copy link
Contributor Author

m-eitan commented May 9, 2022

@bschaatsbergen Thanks a lot for your response :)
Added the changelog

Copy link
Member

@bschaatsbergen bschaatsbergen 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, could you check this out please :)

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 9, 2022
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 🚀.

% make testacc TESTARGS='-run=TestAccELBV2ListenerRule_updateRulePriority\|TestAccELBV2ListenerRule_basic\|TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew' PKG=elbv2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elbv2/... -v -count 1 -parallel 2  -run=TestAccELBV2ListenerRule_updateRulePriority\|TestAccELBV2ListenerRule_basic\|TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew -timeout 180m
=== RUN   TestAccELBV2ListenerRule_basic
=== PAUSE TestAccELBV2ListenerRule_basic
=== RUN   TestAccELBV2ListenerRule_updateRulePriority
=== PAUSE TestAccELBV2ListenerRule_updateRulePriority
=== RUN   TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew
=== PAUSE TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew
=== CONT  TestAccELBV2ListenerRule_basic
=== CONT  TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew
--- PASS: TestAccELBV2ListenerRule_basic (240.54s)
=== CONT  TestAccELBV2ListenerRule_updateRulePriority
--- PASS: TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew (252.01s)
--- PASS: TestAccELBV2ListenerRule_updateRulePriority (266.27s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elbv2	510.582s

@ewbankkit
Copy link
Contributor

@m-eitan Thanks for the contribution 🎉 👏.

@bschaatsbergen
Copy link
Member

bschaatsbergen commented May 9, 2022

Nice, thanks for the contribution 🎉 @m-eitan

@ewbankkit ewbankkit merged commit 8712d9a into hashicorp:main May 9, 2022
@github-actions github-actions bot added this to the v4.14.0 milestone May 9, 2022
@m-eitan
Copy link
Contributor Author

m-eitan commented May 10, 2022

Awesome thanks a lot for all your work :) @bschaatsbergen @ewbankkit

@github-actions
Copy link

This functionality has been released in v4.14.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. Thank you!

@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 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/S 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.

None yet

4 participants