-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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_target_group: When type is network, stickiness not supported #2746
Comments
I have manually created NLB with exact configuration as shown below and it is working fine. By documentation,
Now, when creating Network Load Balancer, stickiness is still enabled by default.
Below is my terraform script and the problem is reproducible.
|
+1 for me |
Hi @dhumraketu - this is an unfortunate set of defaults which will likely need to be revisited at some point. I'll leave that one to a HashiCorp employee however, since it will likely involve a breaking change. |
I am not getting this problem and can create NLBs no problem. The differences I see are
Could be the issue is tied to IP targets?
|
Workaround:
Example:
|
Thanks @ykrevnyi. That worked for me. |
Hey all, just an update on this and sorry for the delay in fixing! So I could not reproduce this using the config here, but I think the core of the problem (judging from the output in the original issue) is that the current validation method for #2954 changed this by moving that check up to the In the spirit of moving this along I have added a commit to #2954 that fixes this, and adds tests and documentation. I want to get more eyes on this from members of the team here that are generally on the AWS provider the most, and then hopefully we can get it merged. Thanks for your patience on this one and sorry for the delay! |
The fix for this has been merged into master and will be released in v1.10.0, which I'll be cutting very shortly. Thanks for your patience and the fixes by @mattgiles and @vancluever! |
terraform-provider-aws_v1.10.0_x4
|
@bflad @mattgiles @vancluever The issue still exists in v1.10.0 unfortunately.
|
Did you try setting the stickiness block but to disabled? |
Thanks, that works. I assumed that the fix won't longer enable stickiness by default for network load balancers, but I guess I was mistaken. |
The workaround that worked for me was:
|
Commenting this issue as it is occurring with the current Terraform and none of the described workarounds work for me. Terraform v0.12.10 provider.aws v2.32.0
produces below error:
If I define block stickiness as such:
I get:
I have contacted AWS support and they verified that AWS API is receiving the following:
TCP/TLS target groups cannot have "stickiness" attribute hence the error. Finally, if I don't include stickiness argument or block, I get:
Which looks like stickiness is enabled by default by Terraform. Does anyone have a solution for 2019? |
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! |
This issue was originally opened by @mcraig88 as hashicorp/terraform#16971. It was migrated here as a result of the provider split. The original body of the issue is below.
When using an ALB of type Network, an error is thrown stating that "Network Load Balancers do not support Stickiness" ( I did not define stickiness ). It looks like Stickiness is enabled by default.
When providing the stickiness block as below, I now get another error
Terraform Version
v.0.11.1
Terraform Configuration Files
resource "aws_lb_target_group" "serviceLoadBalancer-nlb-targetGroup" {
count = "${lookup(map("true", 0, "false", 1), var.ssl_passthrough_enabled)*(var.load_balancer_type == "network" ? 1 : 0)}"
name = "${var.elb_name_prefix}-elb-target"
port = "${var.service_host_http_port}"
protocol = "TCP"
vpc_id = "${lookup(module.defaultVars.vpc_ids, format("%s.%s", var.aws_account_alias, var.aws_region))}"
deregistration_delay = "${var.target_group_deregistration_delay}"
stickiness {
type = "lb_cookie"
enabled = false
}
}
...
Debug Output
Error: Error running plan: 1 error(s) occurred:
module.ecs-http-service.aws_lb_target_group.serviceLoadBalancer-nlb-targetGroup: 1 error(s) occurred:
module.ecs-http-service.aws_lb_target_group.serviceLoadBalancer-nlb-targetGroup: Network Load Balancers do not support Stickiness
Expected Behavior
When ALB type of Network, then stickiness should default to false.
Actual Behavior
Stickiness defaults to true.
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
terraform init
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: