-
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
aws_lb_listener_rule: Stickiness block not removed from state #15144
Comments
Hi @ian-bartholomew, thank you for creating this issue! Looking at the ~ action {
order = 1
type = "forward"
~ forward {
- stickiness {
- duration = 3600 -> null
- enabled = true -> null
} This could stem from some custom logic in the resource that modifies the diff behavior, so further investigation is needed. In the meantime, I would recommend disabling |
@anGie44 Sorry for the late reply, but thank you. I did what you suggested as a workaround and that worked. Thanks! |
Hopefully the information below is helpful for you guys. My terraform version is 0.12.24 though. But by checking the release nots, I don't think it makes any difference from your TF version. I think terraform is unable to remove the stickiness because it's trying to set duration value back to 0. However, the minimum value of the duration is 1 in AWS. That's exactly what you got from the error. I'm actually getting the same error with different scenario, see follow steps:
It seems like the default stickiness state in terraform is: So couple of problems here:
|
I've run into exactly the same case as likai057187. It seems that a workaround is to use:
|
This is still an issue with terraform 14.4 and bcsgh's workaround has resolved this for me. |
Having the same issue here, this is my conf resource "aws_lb_listener" "https" {
load_balancer_arn = aws_lb.alb.arn
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
certificate_arn = data.aws_acm_certificate.main_domain.arn
default_action {
order = 1
type = "forward"
forward {
stickiness {
duration = 1
enabled = false
}
target_group {
arn = aws_lb_target_group.blue.arn
weight = 100
}
target_group {
arn = aws_lb_target_group.green.arn
weight = 0
}
}
} but every time that I made a plan got this drift ~ default_action {
# (2 unchanged attributes hidden)
~ forward {
~ stickiness {
~ duration = 1 -> 0
# (1 unchanged attribute hidden)
}
# (2 unchanged blocks hidden)
}
} But if inside of the stickiness block I set the
I been try to add a ignore_changes in the lifecycle without luck lifecycle {
ignore_changes = [
default_action[0].forward[0].stickiness[0].duration,
]
} |
Has this issue been fixed yet? I am still running into it and the workarounds mentioned here did not work for me |
Any update on this? |
Related to #22526 |
This functionality has been released in v5.36.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! |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When stickiness is not declared in the resource, the listener rule should not use it
Actual Behavior
We had previously had a rule with stickiness enabled, and applied it. Later our use case changed and we removed it. Yesterday we went to update the rule and got this error when applying:
Checking in the AWS console, the listener rule didn't have stickiness enabled. Looking into the plan, we can see that the plan does include the stickiness:
Steps to Reproduce
terraform apply
with stickiness defied in anaws_lb_listener_rule
terraform apply
again, and notice the above error.The text was updated successfully, but these errors were encountered: