-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/lb_listener_rule: update maximum priority value to 50000 #3379
resource/lb_listener_rule: update maximum priority value to 50000 #3379
Conversation
8a3097d
to
04b2681
Compare
This is a great catch! 😄 Do you mind simplifying this even further by removing the custom function and switching it to |
@bflad change applied and pushed. |
aws/resource_aws_lb_listener_rule.go
Outdated
@@ -154,7 +154,7 @@ func resourceAwsLbListenerRuleRead(d *schema.ResourceData, meta interface{}) err | |||
|
|||
// Rules are evaluated in priority order, from the lowest value to the highest value. The default rule has the lowest priority. | |||
if *rule.Priority == "default" { | |||
d.Set("priority", 99999) | |||
d.Set("priority", 50000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 In thinking about this a lot more, I think this will actually be a breaking change for anyone who managed to import a listener default
rule (then set priority = 99999
in their configuration to match). We would need to migrate their state and note the "breaking" change.
That said, I just verified its technically possible to have a default
priority rule and a 50000
priority rule, so changing default rules to 50000
could also be confusing as its also "incorrect". 🤷♂️
Maybe the most correct answer here is changing the attribute to type string and accepting default
priority, but only for import. Or having a separate, special aws_lb_listener_default_rule
resource (the API does error if you try to delete default rules). This is all turning into a lot of work though 😓 .
I'm not sure how you'd want to proceed but the quick way to fix the actual validation except default rules is to leave default rules set to 99999 and go back to the custom validation function where it allows 99999 along with the correct priority range of 1 through 50000. 🤕
Indeed it's a minor change in code but breaking change for user. I didn't realize the impact on imported resources as I never deal with |
😅 From my comment earlier today, you'll also need to go back to the old custom |
Ah, I think I get your point this time:smirk:. I wasn't thinking enough and lack of experiences on handling such scenarios. |
e286296
to
57acdcb
Compare
57acdcb
to
7d51f3a
Compare
7d51f3a
to
8e33671
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks again for finding this. 🚀
This has been released in version 1.10.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
update according to the latest document:
https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateRule.html