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

Stickiness support for source_ip broke valid configurations for NLB #15603

Closed
alex1x opened this issue Oct 12, 2020 · 2 comments · Fixed by #15613
Closed

Stickiness support for source_ip broke valid configurations for NLB #15603

alex1x opened this issue Oct 12, 2020 · 2 comments · Fixed by #15613
Assignees
Labels
bug Addresses a defect in current functionality. partition/aws-us-gov Pertains to the aws-us-gov partition. service/elbv2 Issues and PRs that pertain to the elbv2 service.

Comments

@alex1x
Copy link
Contributor

alex1x commented Oct 12, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

0.13.1
3.10

Affected Resource(s)

  • aws_lb_target_group

Terraform Configuration Files

Before this was merged, I used blocks like

  stickiness {
    type    = "lb_cookie"
    enabled = false
  }

because due to a previous bug in order to disable stickiness you had to set lb_cookie as your type, even though it wasn't appropriate for the NLB (was the only available one), because the config otherwise complained that type was not set, even though the only desired effect was to disable stickiness.

These configurations worked fine up to 3.10 where they fail with InvalidConfigurationRequest: Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol, even though enabled is (still) set to false. I think it shouldn't complain about the stickiness type when enabled is set to false.

Expected Behavior

When stickiness block is configured as enabled = false it doesn't complain about the type of stickiness.

Actual Behavior

Terraform fails with Stickiness type 'lb_cookie' is not supported for target groups with the TCP protocol

Steps to Reproduce

Add this block

  stickiness {
    type    = "lb_cookie"
    enabled = false
  }

to a NLB target group.

References

@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Oct 12, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 12, 2020
@YakDriver YakDriver added partition/aws-us-gov Pertains to the aws-us-gov partition. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 12, 2020
@YakDriver
Copy link
Member

YakDriver commented Oct 12, 2020

Thank you for reporting this problem! I can verify that this is an issue. We apologize for the inconvenience and unforeseen breaking change.

As we work through a way forward, I'll provide some context around the problem. There are two competing priorities here. First, we don't want to break existing configurations (your issue). Second, we want to be consistent with AWS. Prior to 3.10, lb_cookie/TCP was an invalid combination and AWS would give the same error you're seeing. However, the AWS provider was adding a layer of protection by not submitting the enabled = false configuration to AWS. This violates the AWS's provider's general principle of maintaining consistency with AWS.

Workarounds

There are two workarounds for affected TCP, UDP, TCP_UDP, and TLS protocol configurations with type = "lb_cookie" and enabled = false:

  1. remove the stickiness block, or
  2. change the type to source_ip

Broken config in 3.10:

resource "aws_lb_target_group" "test" {
   protocol = "TCP" # or "UDP", "TCP_UDP", or "TLS"
   # other config

   stickiness {
     type    = "lb_cookie"
     enabled = false
   }
 }

Workaround 1:

resource "aws_lb_target_group" "test" {
   protocol = "TCP" # or "UDP", "TCP_UDP", or "TLS"
   # other config
 }

Workaround 2:

resource "aws_lb_target_group" "test" {
   protocol = "TCP" # or "UDP", "TCP_UDP", or "TLS"
   # other config

   stickiness {
     type    = "source_ip"
     enabled = false
   }
 }

@ghost
Copy link

ghost commented Dec 11, 2020

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!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
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. partition/aws-us-gov Pertains to the aws-us-gov partition. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
2 participants