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

feat: adding support for connection termination in aws_lb_target_group #21130

Merged

Conversation

loitho
Copy link
Contributor

@loitho loitho commented Oct 3, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Closes #17227

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSLBTargetGroup'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSLBTargetGroup -timeout 180m
=== RUN   TestAccAWSLBTargetGroupAttachment_basic
=== PAUSE TestAccAWSLBTargetGroupAttachment_basic
=== RUN   TestAccAWSLBTargetGroup_networkLB_TargetGroupWithConnectionTermination
=== PAUSE TestAccAWSLBTargetGroup_networkLB_TargetGroupWithConnectionTermination
[...]
=== CONT  TestAccAWSLBTargetGroup_TCP_HTTPHealthCheck
--- PASS: TestAccAWSLBTargetGroup_BackwardsCompatibility (21.88s)
=== CONT  TestAccAWSLBTargetGroup_networkLB_TargetGroupWithConnectionTermination
--- PASS: TestAccAWSLBTargetGroup_TCP_HTTPHealthCheck (38.40s)
=== CONT  TestAccAWSLBTargetGroup_networkLB_TargetGroupWithProxy
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroupWithConnectionTermination (37.45s)
[...]
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       989.693s

Hi, it's my first PR, hopefully I've done everything correctly, please tell me if not !
As stated in the title, I'm just adding support for the connection termination which is super necessary for me and a lot of people I assume.
I basically copied what was done for the proxy_protocol_v2 option

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/elbv2 Issues and PRs that pertain to the elbv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Oct 3, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @loitho 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 4, 2021
@loitho
Copy link
Contributor Author

loitho commented Oct 16, 2021

Hi,
I updated the PR, to fix the merge conflict on the main branch following the AWS provider refactor
I also re ran the "new" tests :

#  TF_ACC=1 go test ./internal/service/elbv2 -v -count 1 -parallel 2 -run='TestAccELBV2TargetGroup' -timeout=180m
=== RUN   TestAccELBV2TargetGroupAttachment_basic
=== PAUSE TestAccELBV2TargetGroupAttachment_basic
[...]
=== RUN   TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination
=== PAUSE TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination
[...]
=== CONT  TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination
--- PASS: TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination (35.46s)
[...]
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elbv2      1567.739s

This option would be very useful to us (and apparently quite a lot of other people as per the linked issue) any idea on when you guys would be able to take a look at it ? :)

Kind regards

@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@YakDriver YakDriver self-assigned this Nov 22, 2021
@YakDriver YakDriver added this to the Roadmap milestone Nov 22, 2021
@YakDriver
Copy link
Member

YakDriver commented Nov 22, 2021

@loitho Thanks for your work on this PR! After a quick look, it looks like you've done a complete job, with implementation to both resource and data source and tests. 💯 Over the next little while, I'll take a closer look. If there are minor changes needed, to speed up merge time, I may simply make them. Thanks again!

@YakDriver YakDriver force-pushed the f_aws_lb_target_group_connection_termination branch from 88fc1ef to 543ec26 Compare November 29, 2021 18:33
@github-actions github-actions bot added pre-service-packages Includes pre-Service Packages aspects. size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Nov 29, 2021
@github-actions github-actions bot removed pre-service-packages Includes pre-Service Packages aspects. size/XL Managed by automation to categorize the size of a PR. labels Nov 29, 2021
@github-actions github-actions bot added the size/M Managed by automation to categorize the size of a PR. label Nov 29, 2021
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🎉 Thank you

Output from acceptance tests (GovCloud):

% make testacc TESTS=TestAccELBV2TargetGroup PKG=elbv2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elbv2/... -v -count 1 -parallel 20 -run='TestAccELBV2TargetGroup' -timeout 180m
--- PASS: TestAccELBV2TargetGroup_A_missingPortProtocolVPC (59.25s)
--- PASS: TestAccELBV2TargetGroup_namePrefix (59.93s)
--- PASS: TestAccELBV2TargetGroup_Defaults_application (61.67s)
--- PASS: TestAccELBV2TargetGroup_generatedName (61.74s)
--- PASS: TestAccELBV2TargetGroup_A_basic (61.83s)
--- PASS: TestAccELBV2TargetGroup_A_namePrefix (62.16s)
--- PASS: TestAccELBV2TargetGroup_Defaults_network (62.83s)
--- PASS: TestAccELBV2TargetGroup_enableHealthCheck (78.34s)
--- PASS: TestAccELBV2TargetGroup_changeVPCForceNew (91.66s)
--- PASS: TestAccELBV2TargetGroup_NetworkLB_targetGroupWithProxy (99.66s)
--- PASS: TestAccELBV2TargetGroup_A_updateHealthCheck (99.83s)
--- PASS: TestAccELBV2TargetGroup_TCP_httpHealthCheck (107.33s)
--- PASS: TestAccELBV2TargetGroup_withoutHealthCheck (45.04s)
--- PASS: TestAccELBV2TargetGroup_A_setAndUpdateSlowStart (108.14s)
--- PASS: TestAccELBV2TargetGroup_A_tags (109.60s)
--- PASS: TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination (110.82s)
--- PASS: TestAccELBV2TargetGroup_A_lambda (51.33s)
--- PASS: TestAccELBV2TargetGroup_changeProtocolForceNew (114.74s)
--- PASS: TestAccELBV2TargetGroup_A_generatedName (56.41s)
--- PASS: TestAccELBV2TargetGroup_A_updateLoadBalancingAlgorithmType (147.79s)
--- PASS: TestAccELBV2TargetGroup_NetworkLB_targetGroup (148.23s)
--- PASS: TestAccELBV2TargetGroup_A_updateStickinessEnabled (151.83s)
--- PASS: TestAccELBV2TargetGroup_basicUdp (53.64s)
--- PASS: TestAccELBV2TargetGroup_A_changeVPCForceNew (94.08s)
--- PASS: TestAccELBV2TargetGroupAttachment_basic (155.89s)
--- PASS: TestAccELBV2TargetGroup_stickinessValidALB (102.40s)
--- PASS: TestAccELBV2TargetGroup_A_changeNameForceNew (105.51s)
--- PASS: TestAccELBV2TargetGroup_stickinessDefaultALB (53.20s)
--- PASS: TestAccELBV2TargetGroup_stickinessInvalidNLB (76.01s)
--- PASS: TestAccELBV2TargetGroup_A_changePortForceNew (97.91s)
--- PASS: TestAccELBV2TargetGroup_A_lambdaMultiValueHeadersEnabled (123.02s)
--- PASS: TestAccELBV2TargetGroup_updateHealthCheck (93.55s)
--- PASS: TestAccELBV2TargetGroup_basic (49.33s)
--- PASS: TestAccELBV2TargetGroup_changePortForceNew (93.45s)
--- PASS: TestAccELBV2TargetGroup_stickinessInvalidALB (97.15s)
--- PASS: TestAccELBV2TargetGroup_protocolGeneve (59.48s)
--- PASS: TestAccELBV2TargetGroup_Protocol_tls (42.79s)
--- PASS: TestAccELBV2TargetGroup_protocolGeneveNotSticky (92.04s)
--- PASS: TestAccELBV2TargetGroup_protocolVersion (44.42s)
--- PASS: TestAccELBV2TargetGroup_ProtocolVersionGRPC_healthCheck (45.49s)
--- PASS: TestAccELBV2TargetGroup_backwardsCompatibility (43.33s)
--- PASS: TestAccELBV2TargetGroup_updateStickinessEnabled (130.43s)
--- PASS: TestAccELBV2TargetGroup_updateAppStickinessEnabled (121.63s)
--- PASS: TestAccELBV2TargetGroup_stickinessDefaultNLB (121.66s)
--- PASS: TestAccELBV2TargetGroup_preserveClientIPValid (77.91s)
--- PASS: TestAccELBV2TargetGroup_tags (122.60s)
--- PASS: TestAccELBV2TargetGroup_A_changeProtocolForceNew (79.71s)
--- PASS: TestAccELBV2TargetGroup_attrsOnCreate (65.03s)
--- PASS: TestAccELBV2TargetGroup_ProtocolVersionHTTPGRPC_update (66.53s)
--- PASS: TestAccELBV2TargetGroupAttachment_lambda (44.39s)
--- PASS: TestAccELBV2TargetGroup_ProtocolTCPHealthCheck_protocol (53.17s)
--- PASS: TestAccELBV2TargetGroup_changeNameForceNew (56.53s)
--- PASS: TestAccELBV2TargetGroup_stickinessValidNLB (142.12s)
--- PASS: TestAccELBV2TargetGroupAttachment_backwardsCompatibility (118.67s)
--- PASS: TestAccELBV2TargetGroupAttachment_disappears (115.45s)
--- PASS: TestAccELBV2TargetGroupAttachment_port (129.02s)
--- PASS: TestAccELBV2TargetGroupAttachment_ipAddress (139.28s)
--- PASS: TestAccELBV2TargetGroupDataSource_basic (192.63s)
--- PASS: TestAccELBV2TargetGroupDataSource_appCookie (195.90s)
--- PASS: TestAccELBV2TargetGroupDataSource_backwardsCompatibility (261.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elbv2	418.894s

Output from acceptance tests (us-west-2):

% make testacc TESTS=TestAccELBV2TargetGroup PKG=elbv2 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elbv2/... -v -count 1 -parallel 20 -run='TestAccELBV2TargetGroup' -timeout 180m
--- PASS: TestAccELBV2TargetGroup_A_lambda (23.05s)
--- PASS: TestAccELBV2TargetGroup_A_generatedName (31.37s)
--- PASS: TestAccELBV2TargetGroup_generatedName (34.30s)
--- PASS: TestAccELBV2TargetGroup_Defaults_application (40.82s)
--- PASS: TestAccELBV2TargetGroup_enableHealthCheck (42.67s)
--- PASS: TestAccELBV2TargetGroup_Defaults_network (43.19s)
--- PASS: TestAccELBV2TargetGroup_changeVPCForceNew (60.34s)
--- PASS: TestAccELBV2TargetGroup_ProtocolTCPHealthCheck_protocol (69.10s)
--- PASS: TestAccELBV2TargetGroup_A_changeVPCForceNew (69.70s)
--- PASS: TestAccELBV2TargetGroup_basicUdp (38.80s)
--- PASS: TestAccELBV2TargetGroup_A_changeProtocolForceNew (73.08s)
--- PASS: TestAccELBV2TargetGroup_A_tags (74.26s)
--- PASS: TestAccELBV2TargetGroup_changeProtocolForceNew (74.38s)
--- PASS: TestAccELBV2TargetGroup_A_updateHealthCheck (74.94s)
--- PASS: TestAccELBV2TargetGroup_changePortForceNew (75.29s)
--- PASS: TestAccELBV2TargetGroup_A_namePrefix (41.13s)
--- PASS: TestAccELBV2TargetGroup_changeNameForceNew (75.47s)
--- PASS: TestAccELBV2TargetGroup_basic (40.11s)
--- PASS: TestAccELBV2TargetGroup_A_setAndUpdateSlowStart (72.62s)
--- PASS: TestAccELBV2TargetGroup_A_updateStickinessEnabled (111.04s)
--- PASS: TestAccELBV2TargetGroup_A_updateLoadBalancingAlgorithmType (112.57s)
--- PASS: TestAccELBV2TargetGroup_Protocol_tls (53.04s)
--- PASS: TestAccELBV2TargetGroup_withoutHealthCheck (38.63s)
--- PASS: TestAccELBV2TargetGroup_A_missingPortProtocolVPC (57.59s)
--- PASS: TestAccELBV2TargetGroup_ProtocolVersionGRPC_healthCheck (53.52s)
--- PASS: TestAccELBV2TargetGroup_A_basic (53.62s)
--- PASS: TestAccELBV2TargetGroup_protocolVersion (53.75s)
--- PASS: TestAccELBV2TargetGroup_attrsOnCreate (86.08s)
--- PASS: TestAccELBV2TargetGroup_TCP_httpHealthCheck (85.99s)
--- PASS: TestAccELBV2TargetGroupAttachment_ipAddress (131.14s)
--- PASS: TestAccELBV2TargetGroupAttachment_basic (147.29s)
--- PASS: TestAccELBV2TargetGroup_A_changePortForceNew (88.41s)
--- PASS: TestAccELBV2TargetGroup_backwardsCompatibility (49.74s)
--- PASS: TestAccELBV2TargetGroupAttachment_lambda (57.47s)
--- PASS: TestAccELBV2TargetGroup_updateHealthCheck (88.06s)
--- PASS: TestAccELBV2TargetGroup_A_changeNameForceNew (96.56s)
--- PASS: TestAccELBV2TargetGroup_A_lambdaMultiValueHeadersEnabled (104.07s)
--- PASS: TestAccELBV2TargetGroup_stickinessInvalidNLB (66.81s)
--- PASS: TestAccELBV2TargetGroup_stickinessDefaultALB (47.95s)
--- PASS: TestAccELBV2TargetGroupDataSource_appCookie (202.61s)
--- PASS: TestAccELBV2TargetGroup_protocolGeneveNotSticky (96.05s)
--- PASS: TestAccELBV2TargetGroup_updateStickinessEnabled (133.22s)
--- PASS: TestAccELBV2TargetGroup_stickinessValidALB (85.90s)
--- PASS: TestAccELBV2TargetGroup_namePrefix (47.73s)
--- PASS: TestAccELBV2TargetGroup_stickinessInvalidALB (93.13s)
--- PASS: TestAccELBV2TargetGroup_updateAppStickinessEnabled (126.51s)
--- PASS: TestAccELBV2TargetGroup_protocolGeneve (53.59s)
--- PASS: TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination (78.45s)
--- PASS: TestAccELBV2TargetGroup_stickinessDefaultNLB (116.51s)
--- PASS: TestAccELBV2TargetGroup_ProtocolVersionHTTPGRPC_update (79.58s)
--- PASS: TestAccELBV2TargetGroup_tags (117.25s)
--- PASS: TestAccELBV2TargetGroupAttachment_backwardsCompatibility (120.75s)
--- PASS: TestAccELBV2TargetGroupAttachment_port (125.82s)
--- PASS: TestAccELBV2TargetGroup_preserveClientIPValid (64.42s)
--- PASS: TestAccELBV2TargetGroup_NetworkLB_targetGroupWithProxy (59.66s)
--- PASS: TestAccELBV2TargetGroup_NetworkLB_targetGroup (104.96s)
--- PASS: TestAccELBV2TargetGroupDataSource_basic (194.13s)
--- PASS: TestAccELBV2TargetGroup_stickinessValidNLB (166.39s)
--- PASS: TestAccELBV2TargetGroupAttachment_disappears (105.92s)
--- PASS: TestAccELBV2TargetGroupDataSource_backwardsCompatibility (189.17s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elbv2	359.514s

@YakDriver YakDriver merged commit 0ae5676 into hashicorp:main Nov 29, 2021
@github-actions github-actions bot modified the milestones: Roadmap, v3.68.0 Nov 29, 2021
@github-actions
Copy link

github-actions bot commented Dec 2, 2021

This functionality has been released in v3.68.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!

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add connection termination control to AWS LB target group
4 participants