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

Missing preserve_client_ip attribute in aws_lb_target_group resource #17550

Closed
aluuu opened this issue Feb 10, 2021 · 11 comments · Fixed by #17731
Closed

Missing preserve_client_ip attribute in aws_lb_target_group resource #17550

aluuu opened this issue Feb 10, 2021 · 11 comments · Fixed by #17731
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@aluuu
Copy link

aluuu commented Feb 10, 2021

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

Description

AWS documentation states that target group has an attribute preserve_client_ip which is missing from the terraform's aws_lb_target_group definition.

New or Affected Resource(s)

  • aws_lb_target_group

Potential Terraform Configuration

resource "aws_lb_target_group" "service_tcp" {
  name                 = local.target_group_tcp_name
  port                 = local.service_tcp_port
  protocol             = "TCP"
  target_type          = "instance"
  vpc_id               = data.aws_vpc.my_infrastructure.id
  deregistration_delay = 120
  preserve_client_ip   = true # <- this attribute is missing at the moment

  health_check {
    enabled             = true
    port                = local.service_tcp_port
    protocol            = "TCP"
    healthy_threshold   = 3
    unhealthy_threshold = 3
  }

  tags = local.default_tags
}

References

@aluuu aluuu added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 10, 2021
@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Feb 10, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 10, 2021
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Feb 10, 2021
@amitdaga
Copy link
Contributor

@ewbankkit @anGie44 Is anyone working on this issue? Otherwise, I could work on it. I am new to Go, so I would also appreciate it if you could share a PR that I can use for reference. Thank you.

@amitdaga
Copy link
Contributor

@ewbankkit @anGie44 I did some research to review the required changes. Also, I pulled a PR that I could use for reference. Currently, I have sufficient information to start making the changes. Hence, I would request you to assign the ticket to me.

@amitdaga
Copy link
Contributor

@ewbankkit @anGie44 I have raised a draft PR (linked above). Could you please check and suggest if this is the right direction to go?
Change summary: I have introduced a new field in the resource schema. Even though the field value needs to be bool but given the field's complexity, I had to change it to TypeString because the zero-value for bool is false. It would be great if you could give it a quick look so that I could proceed with writing the tests, updating CHANGELOG and documentation.

@kschu91
Copy link

kschu91 commented Feb 22, 2021

@amitdaga let me know if I can support with anything, we are also waiting for this to come.

@amitdaga
Copy link
Contributor

@kschu91 I am mostly done with the changes. One question that I have is whether this provider should validate that this new field value cannot be false for UDP and TCP_UDP protocol.

@kschu91
Copy link

kschu91 commented Feb 24, 2021

@kschu91 I am mostly done with the changes. One question that I have is whether this provider should validate that this new field value cannot be false for UDP and TCP_UDP protocol.

I personally think that it would make sense. I mean the AWS API would break anyways, but failing early in the plan phase would be better.

@amitdaga
Copy link
Contributor

@ewbankkit @anGie44 The linked PR is ready for review. Can you please review and share your inputs?

@amitdaga
Copy link
Contributor

@kschu91 Right that adding validation does help during the plan phase. I tried adding it earlier, but it seemed to add a bit of complexity. The validation logic also did not seem to work since I added it in the resourceAwsLbTargetGroupCustomizeDiff method, and that does not seem to be the right place. I also explored putting the validation in the schema definition, but it did not seem possible due to the validation dependency on another field. Sorry for my limited knowledge here. If you could suggest where I should put the validation check, I could give it another try.

@amitdaga
Copy link
Contributor

@ewbankkit @anGie44 The linked PR is ready for review. Can you please review and share your inputs?

@ewbankkit @anGie44 @YakDriver Can you please review and share your inputs on the PR? Thank you.

@YakDriver YakDriver self-assigned this Mar 30, 2021
@github-actions github-actions bot added this to the v3.35.0 milestone Mar 30, 2021
@ghost
Copy link

ghost commented Apr 1, 2021

This has been released in version 3.35.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 for triage. Thanks!

@ghost
Copy link

ghost commented Apr 29, 2021

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 Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
5 participants